Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3    Statistic    FMM    Blog  

FM.VariableLookup

Retrieves the value of named variable that was declared using FM.VariableSet.

Component Version macOS Windows Linux Server iOS SDK
FM Variables 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "FM.VariableLookup"; Name { ; DefaultValue } )   More

Parameters

Parameter Description Example Flags
Name The Name of the variable
DefaultValue The default value to return if variable doesn't exist. Optional

Result

Returns OK or error.

Description

Retrieves the value of named variable that was declared using FM.VariableSet.
This lookup function returns the default value (or empty) if the variable doesn't exist.
Unlike the variables that were introduced in FileMaker 8 these variables are not limited to the File or Script. In other words they can be retrieved from any file in the system regardless of where they were declared.

You can check with FM.VariableExists whether a variable exists.

Examples

Try it:

"Set: " & MBS("FM.VariableSet"; "test"; "test") & ¶ &
"Lookup test: " & MBS("FM.VariableLookup"; "test"; "not found?") & ¶ &
"Lookup test2: " & MBS("FM.VariableLookup"; "test2"; "not found?")

Example result:
Set: OK
Lookup test: test
Lookup test2: not found?

See also

Release notes

Blog Entries

This function checks for a paid license.

Created 2nd June 2022, last changed 31st January 2023


FM.VariableList - FM.VariableNames

💬 Ask a question or report a problem


Start Chat