Skip 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.

find script

Featured Replies

I have a built a script to execute a find request - however the returned results are not the same as if I create the find request mannually.

The reason for the script is to utilize a graphical interface to simplify an and/or/omit type of search across several keyword fields.

To make life easy, I created two concatenated fields that are strings of all the keywords associated to the record. When searching, we search on those two fields.

So, for example - keyword1 is "blue" and keyword2 is "Wine"

If you search indvidualy for "blue" you get 24 records returned and "wine" returns 116 both from the script and manaul finds.

However, if you search for "blue" or "wine" manually you return 138 records. The script only returns 116 however.

And, if you search for "blue" and "wine" manually you get 2 records back. Via the script, you do not return ANY records.

When I get the no records found error, if I click modify find, I can see the search terms appear to be just the way I want it. In the "And" case there is only one find request, and searchString1 is "blue" and searchString2 is "wine". When I click continue script, I get the same error.

Why would the script be producing different results?

Picture_1.png

Because you never turn into find-mode, by the look of your script.

http://www.filemaker.com/help/Script-Steps26.html

--sd

  • Author

Sorry, I only sent the portion of the script that deals with creating the find,

The first script that is called changes the layout to bring up my GUI search layout, clears all previous search terms, and enters the find mode.

So, we are actually in find mode as the script is working - otherwise, I would be changing the search strings of an actual record.

Ok! Are the searchvariables global fields you won't get any values from related tables not global, otherwise load the values into a pair of $ variable before turning into find-mode ... what is weird is you have correct values when you issue a:

http://www.filemaker.com/help/Script-Steps74.html

...or do you?

--sd

  • Author

Ok! Are the searchvariables global fields you won't get any values from related tables not global, otherwise load the values into a pair of $ variable before turning into find-mode ... what is weird is you have correct values when you issue a:

http://www.filemaker.com/help/Script-Steps74.html

...or do you?

--sd

Yes SearchTerm1 and 2 are global fields.

I do not issue a "modify find" command at any point. However when I get the "no records returned" error, if I choose the "Modify Find" Button, I can see the find request looks like I would create it, but I still get no records returned.

Have you interchanged the values your're setting?

Why not make us a template of this specific area of your solution??

--sd

In the "And" case there is only one find request, and searchString1 is "blue" and searchString2 is "wine". When I click continue script, I get the same error.

It looks like we need to figure out what your definition of "AND" and "OR" are.

A FileMaker AND find would only product 1 find request. The OR find would have a second request.

Please supply examples of what you are looking for exactly.

  • Author

I'm not sure that I understood your interchange question.

Here's a stripped down version of the database that I am trying to deal with.

searchTemplate.fp7.zip

I came to think ... this is actually two and searches isn't it? I would rather keep my sanity by disributing the keywords inside the same request if it's an AND'ed search, and similar distribute the keywords diagonally when OR'ing with the creation of enough requests - via the scripting only. I would not use a calc'field based upon a global field, as suggested in the original template.

--sd

Yes I somewhat agree with you but I wasnt sure how many fields ultimately there would have to be searches across in the OP final solution. Also, I was just trying to modify Agent Ska's file.

  • Author

I came to think ... this is actually two and searches isn't it? I would rather keep my sanity by disributing the keywords inside the same request if it's an AND'ed search, and similar distribute the keywords diagonally when OR'ing with the creation of enough requests - via the scripting only. I would not use a calc'field based upon a global field, as suggested in the original template.

--sd

I'm sorry - I am not following this at all.

Putting keywords in several fields in the same request performs and AND'ed search, no need to concatenate them into a string ... unless the number of records is whopping near to datamining (Gigabytes of data), where unnecessary individual indexing of fields should be avoided. Then would a simple string not even be enough - a cartesian product of the key values should be the result of the calc'

To do the same OR'ed will you need to count the number of criterias before looping each value gets it's own individual request ... such a script would if you look at your fields in table view stuff the keys into the grid diagonally.

Check this out if you should happen to subscripe to it??B)

http://www.filemakermagazine.com/videos/faster-or-search-script.html

--sd

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.