Substitute() for text replacement in FileMaker

Beginner

Substitute() replaces all occurrences of a search string within a text value. Learn how to chain multiple substitutions, use it to sanitize input, and understand its case-sensitive behavior.

What you'll learn

  • How Substitute() replaces text and its case-sensitivity behavior
  • How to chain multiple replacements in one Substitute call
  • Common uses: stripping characters, normalizing delimiters, sanitizing input

Substitute ( text ; searchString ; replaceString ) replaces every occurrence of searchString in text with replaceString — and you can chain multiple replacements in a single call.

1/3
1

Replace a substring in text

Substitute finds every occurrence of the search string and replaces it. The search is case-sensitive.

FileMaker Script
# Basic replacement
Substitute ( "Hello World" ; "World" ; "FileMaker" )
// Returns: "Hello FileMaker"

# Strip all spaces from a phone number
Substitute ( Contacts::phone ; " " ; "" )
// "555 123 4567" → "5551234567"

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo