‘Type Ahead’ Style Searching through Portals in FileMaker Pro


FileMaker’s new Script Triggers allow you to achieve a Google-like type ahead search in FileMaker, searching through a Portal. Here is how to set something like this up based on a person’s first and last name.

The more letters you type…

media_1272481271811.png

The more the portal gets filtered…

media_1272481291078.png

Define a Search Field

media_1272477628119.png

Later we will tie a script trigger to this field.

Make it a Global Field

media_1272479007982.png

Create a Calculated Version of that Search Field

media_1272477553648.png

If(IsEmpty(Search by Persons Name); “0¶zzz”; Search by Persons Name & “¶” & Search by Persons Name & “zzz”)

Set the Calculated Result to ‘Text’

media_1272479082458.png

In the Portal Record create a calculated Search Field

media_1272483745631.png

Basically you want the last name on one line and then the full name on the second line. It could also look like this:

It could also look like this:

Last Name & ¶ &
First Name & ” ” & Last Name

This is so the search can look for both first name and last name.

Use the Calculated Version of the Search Fields on both sides in the Relationship

media_1272483808216.png

Use a Greater than and a Less than link to capture all people within that range. Tie it to a calculated field in the portal table that contains ‘First Name’ and ‘Last Name’ concatenated.

Create a Trigger Script

media_1272477784610.png

Trigger Script contents

media_1272477807451.png

On leaving the field, commit the record to update the portal

Tie the Script to a Trigger on the field, ‘OnObjectModify’

media_1272477829212.png

Now every time you type a letter, the search is fired off, narrowing the scope. This function can also work on a regular layout, without the portal filter. Instead of using the global field to filter, you just use it to feed a search.

Advertisements

5 Responses to “‘Type Ahead’ Style Searching through Portals in FileMaker Pro”

  1. Is there a video of this tutorial? As detailed as these instructions are I am new to FMP and am probably missing some minor detail for this to work.

  2. Works on fields like names okay, but how do we handle multi-paragraph text fields…like a table of “how To” processes notes. My use of type-ahead will only find the first word in each paragraph, but no other. I need to be able to portal search for any occurrence of any phrase I search for. Any suggestions?

Trackbacks/Pingbacks

  1. How do I update information in a whole bunch of records at once in FileMaker? | HomeBase Software - July 13, 2012

    […] Articles: Highlighting Rows in FileMaker lists or portals ‘Type Ahead’ Style Searching through Portals in FileMaker Pro Shortening URLs […]

%d bloggers like this: