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.

Overly complicated Find Request?

Featured Replies

Maybe I'm confusing myself, but I'm still getting used to how to make Find calls using the FM PHP API and could use some help.

I have a table with 4 fields: Date, City, Size, Status.

And I have a form where a user can filter the data by checking off one or more of those field values.

So for example the use could check off a number of checkboxes to make the filter criteria:

Date: 08/30/2011…08/30/2011

City: Los Angeles, San Francisco

Size: 100x200, 100x300

Status: Active, Disabled

If all these record combinations existed, I would get back the results:

08/30/2011 LA active 100x200

08/30/2011 LA disable 100x300

08/30/2011 LA disable 100x200

08/30/2011 LA active 100x300

08/30/2011 SF active 100x200

08/30/2011 SF disable 100x300

08/30/2011 SF disable 100x200

08/30/2011 SF active 100x300

This type of request doesn't work because each 2nd request of the same Field, simply overwrites the parameters:

$request->addFindCriterion('Data', '07/26/2009...07/26/2009');

$request->addFindCriterion('City', 'Los Angeles');

$request->addFindCriterion('City', 'San Francisco');

$request->addFindCriterion('Size', '100x200');

$request->addFindCriterion('Size', '100x300');

$request->addFindCriterion('Status', 'Active');

$request->addFindCriterion('Status', 'Disabled');

So now I'm looking at doing a CompoundFind Search.

But then does that mean I need create 8 CompoundFind's to get these results?

My actual data, has about 80 different Cities, 10 size's and 4 statuses. If every option was selected, I would need A LOT of CompoundFind requests, wouldn't I?

Is there a better way I should handle this? Or is this how I need to do it?

If it were SQL, I would simply do:

SELECT *

FROM table

WHERE Date = '2009-07-26'

AND City IN ('Los Angeles', 'San Francisco')

AND Size IN ('100x200', '100x300')

AND Status IN ('Active', 'Disabled')

Thanks.

  • Author

So just in case someone ever stumbles across this thread.

What I ended up doing with this was creating a table and writing my criteria to a field for each (each value seperated by a new line), then created several table relationships for the data and then displayed it as a portal in a layout.

As my criteria changes, I just edit the record in my table and the relationship and thus my portal, displays exactly what I'm after.

I think I just wrapped my head around how FileMaker makes it's data work :) Cool!

It's probably simpler to call a script, passing the filter as a parameter.

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.