Brian Dunning's FileMaker Custom Functions

FM_List_toArray ( _List )

Convert a FileMaker List To a JSON Array

  Be the first to rate this function Log in to vote

Benedick Miller   Benedick Miller - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
"the¶237¶¶rain{¶[in] spain¶falls\in\the¶pl.ain}¶¶¶"
  Sample output:
["the",237,"","rain{","[in] spain","falls\\in\\the","pl.ain}","",""]

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

Converts a FileMaker List to a JSON Array
Requires FM 18 or greater with the While Function

By design empty values are set as empty strings in the array, not to null,
this makes the array easy to convert back to a FileMaker list.
If you need to deal with trailing carrige returns, or empty values, clean the list before using this function.

Number values are saved as numbers, other values are saved as strings.

Sample input:
"the¶237¶¶rain{¶[in] spain¶falls\in\the¶pl.ain}¶¶¶"

Sample Output:
["the",237,"","rain{","[in] spain","falls\\in\\the","pl.ain}","",""]

Recursive: the custom function is not recursive, the while function is recursive
Dependencies: none



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 19 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: