Dynamic field targeting with Set Field by Name

Expert

Use Set Field by Name to write to a field whose name is computed at runtime, enabling generic scripts that work across multiple fields.

What you'll learn

  • How Set Field by Name differs from Set Field
  • How to construct the fully-qualified field name expression
  • How to loop through a list of fields and set each one dynamically

Set Field by Name accepts a text expression that resolves to a fully qualified field name (TableName::FieldName) at runtime. This lets one script step replace a family of nearly identical Set Field steps and is essential for building generic, reusable scripts.

1/3
1

Basic usage

The first argument is a text expression that evaluates to "TableOccurrenceName::FieldName". The second argument is the value to set.

FileMaker Script
Set Variable [ $fieldName ; Value: "Contacts::LastName" ]
Set Field by Name [ $fieldName ; "Smith" ]

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

Sign in to FM Dojo