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.

Finding a Record with Multiple Criteria

Featured Replies

  • Newbies

I'm frustrated and baffled. I have a test DB with the following data:

bar   foo   value

1      dog  77

2      dog  11

1      jim   33

1      dog  88

2      dog  99




This script works:


show (every record whose cell "bar" = 1 and cell "foo" = "dog" )


correctly showing the values 77 and 88



This script works:


show (every record whose cell "value" > 80 and cell "foo" = "dog")


correctly showing the values 88 and 99



BUT, this script (adding a third criterion) fails horribly:


show (every record whose cell "foo" = "dog" and cell "bar" = 1 and cell "value" > 80)

showing the values 77 and 88.

Repeated tests in this area show me that Filemaker only honors the first two criteria, and blatantly ignores the rest!

SO...how can I do the above? I need the search values to be specified by the AppleScript. In the end, I don't even want to see the values...I really need to calculate the total of a set of records found by values in four different cells.

I know how to do this in SQL, but controlling FileMaker is driving me bonkers. I'd give up, except that this is a legacy database with 28,000 financial records that are very important to my mother. :)

Your help would be greatly appreciated. I figure that using AppleScript to control FileMaker's own 'scripts' for finding records may be the way to go, but I can't figure it out.

On my PC it works correctly - shows only 88

  • 2 weeks later...
  • Author
  • Newbies

...I'm confused. AppleScript works on the PC?

So what you tend to do is a AND'ed criteria, what you need to know is that the identifiers database and document references the entire table and the found set respectively, so if your compilation of the script makes a fuzz about more than two criterias in a line, stack them instead:

show (every record whose cell "value" > 80 )

show (every record of document 1 whose cell "foo" = "dog")

show (every record of document 1 whose cell "bar" = 1)

An alternative is to write every cliteria in request 1 and perform a native find.

But why bother doing it in applescript, say if no field is used twice in the query use Set Field in the request on the other hand if you wish to enter several values in the same field, have there since FM6 been an ability to "Constrain Found Set"

--sd

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.