FileMaker Set Variable — scope, naming, and when to use it
BeginnerUnderstand the difference between local and global variables, when to use each, and the naming conventions that keep scripts readable.
What you'll learn
- The difference between local ($) and global ($$) variable scope
- Naming conventions that make scripts easier to read and maintain
- When to use repetitions and why you usually do not need them
Set Variable is one of the most-used script steps in FileMaker. Understanding the difference between local ($var) and global ($$var) scope — and knowing when each is appropriate — prevents subtle bugs that are hard to track down.
1/4
1
Local variables: $ prefix
A local variable ($name) exists only for the duration of the currently running script. When the script ends, the variable is cleared. Local variables are the right choice for most scripting work.
FileMaker Script
Set Variable [ $customerId ; Value: Customers::id ] Set Variable [ $count ; Value: Get ( FoundCount ) ] Set Variable [ $result ; Value: "" ]
Looping through a found set in FileMakerFileMaker script triggers: OnObjectEnter, OnObjectExit, OnObjectSave, OnRecordCommit
Sign in to track your progress and pick up where you left off.
Sign in to FM Dojo