Queries JSON data for an element specified by an object name, an array index, or a path.
JSONGetElement(json;keyOrIndexOrPath)
json
- any text expression or field that contains a JSON object or array.
keyOrIndexOrPath
- any text expression or field that specifies a JSON object name (key), an array index, or a path. See Working with the JSON functions.
text, number
FileMaker Pro 16.0
If the JSON value at keyOrIndexOrPath
is a number or a Boolean, this function returns a number; otherwise, it returns text.
•This function is not supported in runtime solutions and returns "?".
JSONGetElement ( "{ \"a\" : 11, \"b\" : 22, \"c\" : 33 }" ; "b" )
returns 22 as a number.
JSONGetElement ( "[ true, false, true ]" ; 1 )
returns 0 (false) as a number.
From the Example JSON data stored in the $$JSON variable, gets the value of the "name" object of the second "product" object in the array.
JSONGetElement ( $$JSON ; "bakery.product[1]name" )
returns Chocolate Cake as text.