Training Day

Native JSON Functions

Working with JSON in FileMaker

Basic JSON Functions

Reading JSON

Get a single element:

JSONGetElement ( $response; "data" )

Get an array element:

JSONGetElement ( $json; "items[0]" )

Get a nested value:

JSONGetElement ( $json; "address.city" )

Writing JSON

Create a simple JSON object:

JSONSetElement ( "";
    ["name"; "John Doe", JSONString];
    ["age"; 30, JSONNumber];
    ["isActive"; true, JSONBoolean]
)

Create a nested object:

JSONSetElement ( "";
    ["person.name"; "John Doe", JSONString];
    ["person.address.city"; "San Francisco", JSONString];
    ["person.hobbies[0]"; "reading", JSONString]
)

JSON Structure Functions

List all keys in a JSON object:

JSONListKeys ( $json )

List all values in a JSON array:

JSONListValues ( $json; "items" )

Format JSON for readability:

JSONFormatElements ( $json )

Delete an element from JSON:

JSONDeleteElement ( $json; "person.address.city" )

Type Checking Functions

Get the type of a JSON element:

JSONGetType ( $json; "person.age" )

On this page