Jump 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.

Perform Find() search for value in multiple fields

Featured Replies

I am creating a search page layout where the user can enter the search criteria into one field, but it pulls up records that have that data in one of any four different fields.

For example, records contain several fields - Name1, Name2, Name3, Name4.

The user enters "Joe" I need the Find to pull up any records contain the name "Joe" in either Name1, Name2, Name3, or Name4.

I have tried using a Perform Find() script step. The user enters the search criteria into a global field called "Search". Then I tried editing the Find Request to look for records whose Name1 value contains the value of "Search"

I kept coming up with zero records found.

Am I going about this all wrong, or is there a way to use Perform Find() and have it find records based on the value of another field? Maybe my syntax is wrong.

Any help will be appreciated. Thanks.

Jason

You can either create a calculation field of Name1 & "_" & Name2 & "_" & Name3 & "_" & Name4 and perform your find in that field or you can use a script similar to the following:

Allow User Abort [Off]

Set Error Capture [On]

Go to Layout [Find]

Go to Field [gSearch]

Pause/Resume Script [ ]

If [not IsEmpty(gSearch)]

Enter Find Mode [ ]

Set Field [Name1; gSearch]

New Record/Request

Set Field [Name2; gSearch]

New Record/Request

Set Field [Name3; gSearch]

New Record/Request

Set Field [Name4; gSearch]

Perform Find [ ]

If [not Get(FoundCount)]

Show Custom Dialog ["No records were found with the given criteria."]

Show All Records

End If

End If

Go to Layout [original]

There's a few ways to do an OR search on multiple fields.

1. Using a calc to concatonate the fields together into one field that can be used for searching.

SearchField (calculation, text result) = field1 &

  • Author

Thanks to both -Queue- and Ender for responding. I used a script similar to the one explained by -Queue-.

My next question was going to be how to find records based on other field data or the results of a function, but using Enter Find Mode, then setting all the field data, then using the Perform Find[] script step, I was able to do just that.

Create an account or sign in to comment

Important Information

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

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.