Brian Dunning's FileMaker Custom Functions


Assign JSON Object passed as Script Parameter to variables automatically

  Average rating: 5.0 (1 vote) Log in to vote

Michael Wallace   Michael Wallace - Show more from this author
Empowered Data Solutions

Share on Facebook Share on Twitter

  Sample input:
JSON.AssignScriptParameters() // Script Named ShowDialog(title;message)
  Sample output:
Variables set $title, $message equal to values in JSON Object passed as Script Parameter

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

* =====================================
* JSON.AssignScriptParameters
* Modified from #AssignScriptParameters
* JSON.AssignScriptParameters uses the current script parameter assuming
* JSON format to declare and populate a series of locally or globally scoped script
* variables. Params with single or no $ are set to locally scoped
* and params starting with "$$" are set to globally scoped variables.
* JSON.AssignScriptParameters also uses the current script name to determine
* whether or not all required named parameters are populated (≠ Null).
* i.e. Assuming appropriate JSON is passed as a parameter a script with the name
* TestScript(a;$b;$$c) would have three variables set $a, $b, and $$C
* True (1) when the script parameter is a valid set of name-value pairs (which
* includes the empty string) and all parameters defined as required according to
* the script name are non-null; False (0) otherwise.
* PORTED on 2019-03-28 by Michael Wallace of Empowered Data Solutions
* ( to use JSON parameters and other improvements
* MODIFIED on 2010-10-04 by to return explicit True or
* False values indicating successful evaluation of the script parameter, and to
* fit syntax inspired by a comment on by
* Richard Dyce.
* CREATED on 2010-03-13 by Jeremy Bante of Kyo Logic (
* INSPIRED by an example in the FileMaker help documentation.
* =====================================



Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: