Middle(), Left(), Right() complex parsing

Beginner

Combine FileMaker's substring functions with Position() and Length() to parse structured strings, codes, and formatted identifiers reliably.

What you'll learn

  • How to use Left(), Right(), and Middle() with dynamic lengths
  • How to extract components from structured identifiers
  • How to handle optional trailing segments
  • How to chain parsing steps with Let() for readability

Left(), Right(), and Middle() are FileMaker's fundamental substring extraction functions. Individually they are simple, but combined with Position() and Length() they can parse any structured text without external libraries. The key is to express lengths and start positions in terms of found delimiter positions rather than hardcoded numbers.

1/4
1

Left() and Right() with dynamic lengths

Hardcoded lengths in Left() or Right() break when values vary. Compute the length from the position of a delimiter.

FileMaker Script
// Extract the portion before ":" in "Category:SubCode"
Let ( [
  text  = Products::Code ;
  colon = Position ( text ; ":" ; 1 ; 1 )
] ;
  If ( colon > 0 ;
    Left ( text ; colon - 1 ) ;  // everything before ":"
    text                          // no ":" -- return the whole string
  )
)

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

Sign in to FM Dojo