Brian Dunning's FileMaker Custom Functions

FmListToArray ( ~list )

Converts 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:
"abc¶237¶d8f¶¶"
  Sample output:
["abc",237,"d8f",""]

  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.

The list may be a list of JSON Objects or JSON Arrays.

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

Sample input:
"abc¶237¶d8f¶¶"

Sample Output:
["abc",237,"d8f",""]


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

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. 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 20 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: