Brian Dunning's FileMaker Custom Functions

JSONListToObject ( objectsList )

Converts a value list of existing JSON objects into a single object.

  Be the first to rate this function Log in to vote

Stephan Casas   Stephan Casas - Show more from this author
http://www.stephancasas.com

Share on Facebook Share on Twitter

  Sample input:
JSONListToObject ( "{\"key0\": \"value0\"}¶{\"key1\": \"value1\"}" )
  Sample output:
"{\"key0\": \"value0\", \"key1\": \"value1\"}"

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

This function is useful when merging existing JSON objects into one single object. For example, you could use the List() function on a field to collect the JSON representations of child records and then use JSONListToObject() to deliver the information as one JSON-accessible text element.

The function works by utilizing my nested Let() function method, which is well-documented in my InsertValue() function on this site.

Data passed into the objectsList parameter must be a value list of valid JSON objects, or the function will fail to evaluate correctly. Invalid parameter data will yield a '?' character at runtime.

 

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: