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 'or' script step

Featured Replies

I have a membership table.

There is a field called Mem_Can that holds either "Member" or "Candidate"

There is a field called TYPE which holds the membership 'type' (Life Member, year member etc)

After importing records, it is possible for Type to erroneously be ""

There is a calculated field called TypeIndex which calculates the numerical position of the 'Type Dropdown' list of types. It holds 2 if the chosen Type is the 2nd choice etc... If a list of Types is imported the stated Type can be wrong. In this case, the TypeIndex is 0 (zero)

So, I need a way to PerformFind:

Members with a Type of ""

OR

Members with a TypeIndex of 0

I need a get(foundcount) that shows the total of either of these two situations. I need to do this in a script without user input. (Hence, the Perform Find)

Try

Enter Find Mode[]

Set Field[TypeIndex; ">0"]

Set Field[Type; "*"]

Perform Find[]

Show Omitted Only

This uses DeMorgan's Theorem, which says that A or B is the same as not (not A and not B).

In this case A=( TypeIndex = 0) so not A= (TypeIndex > 0).

B = (Type = "") so not B = (Type = *).

The two set fields in the same find command perform the and function.

The show omitted step performs the final not function.

  • Author

Is it required that I enter find mode? Can't the script step Perform Find followed by Constrain work? FM seems to 'allow' this combination but noteably it fails to work.

To put it another way, "If I wanted all 'Sculptors' who lived in NY, why wouldn't I do a Perform Find where State = "NY" and then Constrain where Artist="Sculptor" ????

Constrain is more often used when a found set has previously been defined in a different way, e.g. with a go to related record step; or when you have to do something with a found set, and then do something else with a subset of it. I have noticed that it is a lot slower than a simple find; really noticeable on a hosted database.

I find it much easier to follow if I spell out the find criteria rather than use the Perform Find [Restore] with the criteria embedded in the command. This may only be because I •have to• do it that way in the PHP interface to FileMaker. But the criteria in the Perform Find[restore] step don't show up in the script editor--you have to open the script step to see what you were searching for.

It is much cleaner just to

Enter Find Mode

Set Field[state; "ny"]

Set Field[artist; "sculptor"]

Perform Find[]

It does the job quicker, and is easier to troubleshoot down the road.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.