NightWing Enterprises
Demo for FileMaker Pro™

Visual feedback on Matching Text Strings!

Field Search Highlighting

+ For FileMaker 13 and later +

For the benefit of clients and fellow developers, the following demonstration file is provided for free download.

FileMaker Pro is notable for (among many other things) its search capabilities. Find mode allows flexible searching of records, and the Find/Replace feature allows you to step through occurrences of a word by field, record, found set or table. All great capabilities - but there are occasions when users need something slightly different.

On a number of occasions, we've been asked for a way to simultaneously show multiple occurrences of a word or string within a block of text in a FileMaker field. But it's been many years since we last published a demo of a technique for custom search string highlighting, and much has changed since then.

Using the feature set available in FileMaker 13, this new demo adds a number of requested features including optional support for whole word matches and use of the native text highlighting style in FileMaker Pro (in FileMaker Go, where the text highlight style is not supported, bold text format is used in its place).

In addition, the demo incorporates a secondary technique that monitors and manages the record commit state, to ensure that record modification data (date, time, timestamp etc) are not updated as a result of field searching/highlighting activity (i.e. only if user edits are independently applied).

While offering full-featured and automated highlighting of search strings, this technique is nevertheless remarkably quick and easy to implement, requiring no additional fields in your solutions' data tables. Three global fields are required in a separate System table to provide user control of searching and highlighting options, along with a single custom function* that applies the appropriate text formatting. A single script and some object script triggers on the controlling fields (search string, case and whole words) completes the setup.

It should be noted that the approach taken with this demo is not suitable for use in WebDirect solution interfaces, since text level formatting is not supported in WebDirect. Moreover, real-time updating of the search text highlights is appropriate for text strings of moderate length (up to around 2,000 characters in FileMaker Pro and up to 1,000 in FileMaker Go). Meanwhile, due to stack limits for recursive processes, the upper limit of text processing is set at 10,000 characters for free-form string matching and 20,000 characters for whole word matching.

Finally, it should be noted that the technique as implemented here is not suitable for use in solutions where pre-existing highlight text formatting (or bold formatting on iOS) is present in the field(s) being searched and is required to be preserved. Should that be a requirement, additional measures would be needed.

* Installation of Custom Functions in your solution file(s) requires FileMaker Pro Advanced - however, once installed in a given file, they can be accessed and used in that file throughout the FileMaker platform.
  ZIP archive
Field Search Highlighting demo download (.zip archive)

Note 1:

The .zip archive download (above) provides a copy of the demo file suitable for all supported platforms.
Note 2: Before opening the demo file, please ensure you extract it from the .zip archive (eg to a local drive) - otherwise it will open in read-only mode and will not function as intended.
Field Search Highlighting demo for FileMaker Pro 13 and later

This demo is provided free for private and educational purposes, and may be licensed for commercial and business applications. Should you require assistance implementing procedures such as those shown in our example files, please consider establishing an account with us for developer support.