This article is a part of a series on Advanced Search Interfaces.
Using a single, global field and a fairly simple script, you can create a search-engine-like interface for searching the contents of a FileMaker Pro database.

Place a global search field and button in the header of your list layout for search-engine-like search functionality.
Step One: Create a Global Search Field
Create a text field in any table. In the field options, set the new field to use global storage as shown in the figure below.

Under the storage tab in the field options, select the "Use global storage (one value for all records)" check box.
Step Two: Create the Find Script
Create a script that enters find mode, creates a new search request for each field you wish to search, copies the value of the global search field to each of those fields and performs a find.
- Enter find mode (do not pause or specify find request).
- For each field you want to search, use the “Set Field” script step to copy the value from the new global field.
- Place a “New Record/Request” steps in between each “Set Field” step.
- Perform Find.
Here’s a sample of how the script might look:
Enter Find Mode [ ]
Set Field [ Contacts::First Name; Globals::GlobalSearch ]
New Record/Request
Set Field [ Contacts::Last Name; Globals::GlobalSearch ]
New Record/Request
Set Field [ Contacts::Address Type 1; Globals::GlobalSearch ]
New Record/Request
Set Field [ Contacts::City 1; Globals::GlobalSearch ]
New Record/Request
Set Field [ Contacts::State Province 1; Globals::GlobalSearch ]
New Record/Request
Set Field [ Contacts::Postal Code 1; Globals::GlobalSearch ]
Set Error Capture [ On ]
Perform Find [ ]
Set Error Capture [ Off ]
If [ Get ( FoundCount ) = 0 ]
Show Custom Dialog [ Title: "No Records Found"; Message: "No records matched your search criteria."; Buttons: “OK” ]
End If
Step Three: Add Layout Objects
You can then place the global field and a search button to call your new script in your list view header, a pop-up window or wherever else you might find it useful.
That’s it! Now the user can simply enter search terms in the search field and click the search button and view their results without ever entering find mode and without knowing which fields to search.
Enhancement - Split Field Searching
One of the shortcomings of this script is that it will only find records that contain all the search terms in a single field. In other words, if you enter “ABC Plumbing Chicago”, it will only find records that contain the words “ABC Plumbing Chicago” all in the same field. If you want to be able to find a company record for “ABC Plumbing” located in “Chicago”, the script would need to split the phrase up and loop through each word. My article, Google-Like Searches In FileMaker - Non-Contiguous, explains a method to accomplish this.
If you have any questions or comments feel free to post a comment below or contact me directly.






6 Comments
I have tried the first script and it worked fine. However I copy your script for non- Contiguous and I could not get to work. When I set variable I get the word Value inserted and in your script the word Value does not appear. Am I doing something wrong? Could that be the problem? I like this script very much and I hope you can help us make it work.
Aviv Damari
Damari Construction Consulting Inc.
cell 480510500
@Aviv
I suspect the problem may be in the line : Set Variable [ $thisTerm ; GetValue ( $searchList ; $i ) ].
Make sure the Value for the variable is exactly “GetValue ( $searchList ; $i )” (without the quotes). If that doesn’t fix the problem, print the script to a PDF or take a screenshot and email it to me.
Thanks so much for the help with the search engine. Works great. What i was wondering was if you know a way that i can format a layout to hide the database and and to show only the search engine and the search results in a separate space. This link shows what I’m looking for: http://www.senasa.go.cr/Medivet/inicio.aspx
Thanks in advance,
Bob Smith
@Bob Smith - If I understand what you’re trying to accomplish correctly, here’s a general overview of how you could approach this:
Create a restricted user group that only has access to layouts you create for the search. The layout would have only the objects required for the search, and your startup script would lock the status bar so they could only navigate with buttons you provide in the layout. You could take it a step further and create a custom menu set for those layouts which include only the items you want them to have.
I hope that answers your question. It’s a very general explanation. Getting much deeper into details could fill a series of articles. Feel free to comment again or click the contact us link below if you want to discuss more specific details.
i’m a filemaker newbie my question is the same
i’d like a separate layout to display text results.how to accomplish this?please help me.
so simple as possible
Thanks so much for sharing your knowledge! I’ve tried the script and am blown away by how much this will open up my FileMaker design world.