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.

Logical operators in compound find request

Featured Replies

  • Newbies

Hello -

Has anyone had any luck using logical operators in a compound find request? For example, here's a simple request (just for testing purposes):

http://localhost/fmi...mresultset.xml?

–db=Data_Libraries&

–lay=web_Reports&

–query=(q1,q2);(q3);!(q4)&

–q1=pt_Name_First&

–q1.value=Andrew&

–q2=pt_Name_Last&

–q2.value=Schools&

–q3=pt_Social&

–q3.value=1234567890&

–q4=caseType&

–q4.value=TEST&

–findquery

The request above searches for a patient with a first name of "Andrew", a last name of "Schools" and who has a social security # of "1234567890". It's omitting any results that have a caseType with a value of "TEST".

What I would really like to do is use the "cn" logical operator for both the first and last name so someone can search for "and" and that would find any records with the first name LIKE "and". I've already tried several different ways of adding logical operators like:

–q1=pt_Name_First&

–q1.value=Andrew&

–q1.op=cn&

AND

–q1.cn=pt_Name_First&

–q1.value=Andrew&

But the examples above do not work. I can't use a plan old find request because I'm going to need both "AND" and "OR" logical searches in the same find request. For example, I have a value that will need to be searched accross multiple fields so that will require an OR LIKE clause.

I've been playing around with it for most of the day. Took a whole 10 minutes to construct the SQL for the ODBC driver I built but when it comes to this FileMaker PHP API, nothing is fast...

Any help will be appreciated.

Andrew Schools

Small Business Computers of New England

  • 6 months later...
  • Newbies

I am also keen to understand how I represent this sort of search pattern in php, using the AddFIndCriterion call. I have been unable to find any documentation on it at all, except one example:

AddFIndCriterion("Numeric Field Name","<100")

Which did not work on my installation (V12). The Criterion field seems to only take a raw pattern, which it looks for in the specified field.

Anyone got any info?

By default FileMaker actually uses a op=bw search, so putting "and" in should find Andrew. Or you can play with the input from a form before running the search to do "and*" which will force that behaviour...

Cheers

Webko

  • 2 years later...

But what about a search request that includes a logical AND and a logical OR? Is that even possible, been looking for a solution for this for days now....

 

Example:

 

AND

$request1 = $fm->newFindCommand($layoutName);
$request1->addFindCriterion('rID', $KlantNummer);
 
+OR
$request2 = $fm->newFindCommand($layoutName);
$request2->setLogicalOperator(FILEMAKER_FIND_OR);
$request2->addFindCriterion('ID', $search);
$request2->addFindCriterion('FullName', $search);

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.