Brian Dunning's FileMaker Custom Functions

json.unformat ( jsonEntity )

Undoes `JSONFormat()` function by re-interpreting the JSON entity from the root node. Useful for building JSONL (https://jsonlines.org) formatted docs.

  Be the first to rate this function Log in to vote

Cristos Lianides-Chin   Cristos Lianides-Chin - Show more from this author
Codence
https://www.codence.com

Share on Facebook Share on Twitter

  Sample input:
json.unformat ( JSONFormatElements ( JSONSetElement ( "{}" ; [ "foo" ; "bar" ; JSONString ] ; ["foo2" ; "Foo¶Bar" ; JSONString ] ) ) )
  Sample output:
{"foo":"bar","foo2":"Foo\rBar"}

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

When using JSONL format (e.g., for performance when creating/consuming a list of JSON entities) it is imperative that each line be a properly formatted JSON entity. This is easily accomplished in FileMaker by using JSONGetElement ( $jsonEntity ; "" ), which just references the root node of the entity. This custom function is just syntactic sugar for that JSONGeElement pattern.

See also: https://jsonlines.org

 

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: