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.

Search based on use input then omit certain records

Featured Replies

Hi there,

New to FM and would like some help with a search, its for company chairman who refuses to learn how to use the new request feature!

 

I'd like him to be entered into the find mode where he can select the field he wants to search, when he presses enter I need the script to then also search another field, which if it has any values omits those records, finally showing the end results.

 

Many thanks

Tony

Enter Find Mode

Type in the criteria in field one

New Record Request (key combo or Menu Request “New Record Request”)

Go to field two and type in Omit criteria

Perform Find

HTH

Lee

  • Author

Thanks for the reply Lee,

Client will only enter the first field and has no clue about omitting records, since the omit is constant the script could do this after client has made their chose from the first field.

At the moment I have:

Go to layout
Enter find mode [paused] 'this enables client to enter their search criteria'
New record/request
Enter find mode [restore] 'I have put the omit criteria here'
Perform find []

All I get is the last bit of the search, the first part entered by client is ignored

  • Author

Have created a quick file to show whats happening

search.fmp12

Your restored Find request has a search for name="John" in it, so of course it will override any user input and just show unarchived John records. (Double click the step in the Script Workspace to see what is stored in the find step)

That is why I always use the explicit form of the find command:

Enter Find Mode[]//NO RESTORE!!
Set Field [Search::archived; "yes"]
Omit Record[]
Constrain Found Set

That way, the find criteria are right in front of me. Use of Perform Find in this step will ignore the previous user found set also, so use Constrain Found Set

 

Edited by doughemi

  • Author

How do you get the line [search::archived; "yes'] next to the Set field?

Still wont work

search.fmp12

  • Author

Thank you so much for that...

T

  • Author

Based on the attached script, how could I expand this search out to user being able to search multiple fields and then the final 'archive omit', would it just be a case of deciding how many find requests are done before the script does the final constrain found set?

searchmultiple.fmp12

If they're searching multiple fields at the same time, they would just put information in each of the desired boxes - e.g., Charles and 44, then continue the search

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.