JSONListKeys
Lists the object names (keys) or array indexes in JSON data for an element specified by an object name, an array index, or a path.
Format
JSONListKeys ( 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 version
16.0
Notes
- Each returned value, except the last, ends with a carriage return.
Example 1
Gets the names of all objects at the root of the JSON object.
JSONListKeys( "{ \"a\" : 11, \"b\" : 22, \"c\" : 33 }" ; "" )
returns a¶b¶c.
Example 2
From the Example JSON data stored in the $$JSON variable, gets the indexes of all elements in the array in the "product" object.
JSONListKeys ( $$JSON ; "bakery.product" )
returns 0¶1¶2.
Example 3
From the Example JSON data stored in the $$JSON variable, gets the keys of all elements in the first "product" object in the array.
JSONListKeys ( $$JSON ; "bakery.product[0]" )
returns category¶id¶name¶price¶special¶stock.