FileMaker Substitute Function

MANIPULATING TEXT IS USUALLY a big stumbling block for beginning developers.  Mastering those functions  (LeftWords, RightWords, Position, PatternCount, etc.) will make your life much easier.  FullCityConsulting’s explanation of the Substitute function starts with a simple example:

Substitute simply examines some text for a specific set of characters (called a searchString) and replaces them with a new set of characters (the replaceString). Consider this example:

PatternCount

Above, we’re instructing FileMaker to look in the text “Boffins Build Best Butter Dish” and find any instances of the utterly inane word “Boffin”. Should it find any, FileMaker should replace it with the vastly more dignified term “Scientist”. When evaluated, the resulting output is “Scientists Build Best Butter Dish”.

And adds several more helpful examples.  The real power comes from replacing the text to examine with a field or variable name as you loop through records:  Substitute($Contact; “John”; “Jon”).  The output would modify the variable $Contact in this instance.

Study each function closely now, and reap the benefits later.

FileMaker Function of the Week: Substitute.

Liked Liked
Need FileMaker Development Help? Or to purchase FileMaker Software?
Contact FM Pro Gurus for help