Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

searching by multiple fields script

Featured Replies

Hello!

Attached is the current interface I'm creating. [account name:test password:test] I would like to be able to search the database by selecting three cities, counties, zip codes, etc. Currently, one may choose multiple descriptions and an employee size range. But I'm not sure how to construct a script that will search the database based on the specified parameters [ie. selecting 3 possible cities, counties, zip codes]. When I try to search by more than one city, county, or zip code, it finds no matching results even though there are records under these specifications.

I appreciate the help! Any tips on how to improve this is also greatly appreciated.

Thanks,

Sara

help.zip

Edited by Guest

A few tips:

1. I would not use the "City 1" field on the "find page" layout since it looks like it displays raw data in Browse mode. If your user halts the find request at this point then any entries they make will change the database.

2. To perform "or" operations in your find request create new records in find mode. Then use a "Constrain found set" step to add criteria for the Counties. Something like this:

Enter find mode

Set field [City, City1]

If (not IsEmpty (City 2)

New Record/Request

Set field [City, City 2)

End If

If (not IsEmpty (City 3)

New Record/Request

Set field [City, City 3]

End if

Perform find

# Add County criteria

Enter find mode

Set field [County, County1]

If (not IsEmpty (County 2)

New Record/Request

Set field [County, County 2)

End If

If (not IsEmpty (County 3)

New Record/Request

Set field [County, County 3]

End if

Constrain found set

Good luck!

  • Author

I appreciate your help greatly! I'm still constructing the script, however, how can I enter more than one target field for 'set field'?

I know it is probably easier than I think =) Keep in mind I'm a novice.

Thanks again for the prompt response.

Take care,

Sara

Edited by Guest

how can I enter more than one target field for 'set field'?

I suggest that you try it out in find mode before you code it into a script.

What you'll see is that if you enter values into multiple fields in a single record they behave as though connected by logical " and" statements. On the other hand if you create multiple records (in find mode) and fill in different values into the same field they will be treated as logical " or" statements.

I think you should be able to use the sequence of steps that I indicated in my original post. I was too lazy to use your exact field names, but I hope you got the point of it. To answer your question above, if you have sequential "set field" steps then your script will enter values into multiple field in the same record (which will be treated as logical "and"). I suggested using "New Record" steps, while in find mode, to allow criteria to be added as a logical "or".

See the attached modification of your file. It includes:

1. Removed your records (for privacy)

2. Changed City and County fields to global storage

3. Added script "Find City County"

4. Added "find page Copy" layout.

One difference is that it pauses to have the user enter search criteria while in Browse mode, not Find mode.

Happy new year!

HelpClone.fp7.zip

I would like to be able to search the database by selecting three cities, counties, zip codes, etc.

Do you think it is likely that anyone actually wants to do this? Another choice is just to keep it simple and let them search for one city at a time.

I agree with Bruce. If you're users learn how to use filemaker they can form complex searches on their own - without the use of a fancy search page.

To make it a little easier for novice users you could set up a simplef "search" layout (in a list style) with the relevant fields with "and" labels between each field. Make a script with a button labeled "or" which performs a "new record/request" script step to generate a new find record to allow multiple counties or cities to be specified.

  • 3 weeks later...
  • Author

I agree with all you guys. =) The demands I've received are straight from the users themselves. I'm about to take a look at the database, however I will propose your suggestions as I think they are excellent.

I appreciate your help.

Thanks,

Sara

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.