Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3    Statistic  


Queries value from JSON path in array of objects.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
JSON 7.1 Yes Yes Yes Yes Yes
MBS( "JSON.GetArrayPathItems"; json; Path { ; AsValue } )   More


Parameter Description Example value
json A JSON text or reference. "{\"people\":[{\"first\":\"Christian\",\"last\":\"Schmitz\",\"city\":\"Nickenich\"}]}"
Path The path through the json hierarchy as list.
For object, pass name of item to choose. For array pass index.
AsValue Optional
Pass 1 to return as value, e.g. text or number.
Pass 0 (or nothing) to return as JSON.


Returns OK or error.


Queries value from JSON path in array of objects.
The path describes the way through the hierarchy to find the JSON node to return.
Result can be JSON or the value.


Query all test values in objects in array:

MBS("JSON.GetArrayPathItems"; JSON Test::JSON; "test")

Lookup items in array:

MBS( "JSON.GetArrayPathItems"; "[{\"first\":\"Christian\",\"last\":\"Schmitz\",\"city\":\"Nickenich\"}, {\"first\":\"Peter\",\"last\":\"Miller\",\"city\":\"New York\"}]"; "first"; 0 )

Example result:

Lookup item values in array:

MBS( "JSON.GetArrayPathItems"; "[{\"first\":\"Christian\",\"last\":\"Schmitz\",\"city\":\"Nickenich\"}, {\"first\":\"Peter\",\"last\":\"Miller\",\"city\":\"New York\"}]"; "first"; 1 )

Example result:

See also

Blog Entries

Created 27th January 2017, last changed 28th June 2017

JSON.GetArrayItemsAsList   -   JSON.GetArraySize

Feedback: Report problem or ask question.

MBS Xojo PDF Plugins