Brian Dunning's FileMaker Custom Functions

@JSONFormatArray ( json )

Formats JSON Arrays in two columns: elements hierarchy and values.

  Average rating: 3.0 (2 votes) Log in to vote

Alex Zueiv   Alex Zueiv
Tashkent

Share on Facebook Share on Twitter

  Sample input:
@JSONFormatArray ( "[{\"language\":\"en\",\"str\":\"Hello World!\"},{\"language\":\"ru\",\"str\":\"Привет Мир!\"}]" )
  Sample output:
[
    {
        "language"  : "en",
        "str"       : "Hello World!"
    },
    {
        "language"  : "ru",
        "str"       : "Привет Мир!"
    }
]

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

This CF is intended for developers. It allows you to visually separate the data from the document structure. This makes working with JSON API more comfortable.

Required FM16+ (no runtimes).

The old function (@JSONFormatElemets(); v1) was adopted and replaced here to work with JSON Arrays only, of any size. It is suitable to process arrays of JSON elements generated from DB records.

 

Comments

Alex Zueiv   Alex Zueiv, Tashkent
May 15, 2018
Version 2.0 of this CF works much faster:

http://www.briandunning.com/cf/2130
 

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.

Under construction. Email me your wish list for improvements.