JSONGetElement
Purpose
Queries JSON data for an element specified by an object name, an array index, or a path.
Format
JSONGetElement(json;keyOrIndexOrPath)
Parameters
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.
Data type returned
text
Originated in
FileMaker Pro 16.0
Notes
•This function is not supported in runtime solutions and returns "?".
Example 1
JSONGetElement ( "{ \"a\" : 11, \"b\" : 22, \"c\" : 33 }" ; "b" ) returns 22.
Example 2
JSONGetElement ( "[ 10, 20, 30]" ; 1 ) returns 20.
Example 3
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.
Related topics