Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Search with OR instead of AND with a repeating global field


This topic is 6665 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a drop down list where it is necessary to search for any of the items in the list that are selected (by holding down the command (apple) key). This creates a repeating field entry in the find global. The field it is searching is not a repeating field and therefore would never match the repeat of the find global. Is there a way to take each entry in the repeating field and have the search return any records that match any of the words in the repeating find field?

Thanks,

Drew

Posted

Haven't tried it, but how about a scripted find?

Select each of the repeating values one at a time with the '[X]' bracket option after the field name and extend the set for each one.

Yes/No?

Posted

Matt Petrowsky has several tutorials on this at:

http://www.filemakermagazine.com/index.php

Do a search for "OR search" and chose technique and you'll see the list.

HTH

Posted (edited)

You don't need a repeating field for this. Just make a script along the lines of:

# CREATE THE FIRST REQUEST (N = 1)

Enter Find Mode [ ]

#

# START LOOP

Loop

#

# SET THE SEARCHED FIELD TO THE Nth VALUE OF VALUES TO SEARCH FOR

Set Field [ Table::Value; MiddleValues ( Table::gValues ; Get ( RequestCount ) ; 1 ) ]

#

# IF THERE ARE NO MORE VALUES (N ≥ VALUECOUNT), WE ARE DONE

Exit Loop If [ Get ( RequestCount ) ≥ ValueCount ( Table::gValues ) ]

#

# ELSE, CREATE A NEW REQUEST AND REPEAT THE LOOP WITH N = N + 1

New Record/Request

End Loop

#

#

Perform Find [ ]

In this example, 'gValues' is the field that holds multiple values to search for (your drop down list) and 'Value' is the searched field.

Edited by Guest
Posted

Although I can understand most of the script there is some of it that is a little fuzzy for me. I was not able to make the script work, I kept getting an error when I did some of the calculation entry. What would be really helpful is if you could dissect the script and caluculations for me. I know that is asking a lot but it is like teaching me to fish instead of just giving me the fish. In the future I will be able to better help myself.

Thanks so much!

Drew

Posted

On each loop, the script creates a new find request. The request number is used to pick the corresponding value from the stack of values to search for. When the number of requests equals the number of values to search for, we are done.

I have edited my previous post and added some comments (and a minor simplification). If you still experience problems, post the exact error message and what did you do before you got it.

Posted

Can you be more descriptive? The MiddleValues() function in the Set Field[] above looks right to me.

Posted (edited)

I just had to enter it a bit different and got it to work great! Thanks for all the help!

This is what I did instead.

Enter Find Mode []

Loop

Insert Calculated Result [select; Table::Value; MiddleValues ( Table::gValues ; Get (RequestCount) ; 1 )]

Exit Loop IF [( Get ( RequestCount ) ) ≥ ( ValueCount ( Table::gValues ) )]

New Record/Request

End Loop

Edited by Guest
Posted (edited)

After implemting it and reading the help files related to all the used functions I understand what is going on. Thanks so much for this. Without your help I dont think I would reached this good of solution!

Edited by Guest

This topic is 6665 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.