Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Queries value from JSON path in array of objects.

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


Parameter Description Example Flags
json A JSON text or reference.
If that is not an array, the function returns an empty result.
Path The path through the json hierarchy as list.
For object, pass name of item to choose. For array pass index.
AsValue Pass 1 to return as value, e.g. text or number.
Pass 0 (or nothing) to return as JSON.


Returns value 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:

Lookup value in sub item:

MBS( "JSON.GetArrayPathItems"; "[{\"addresses\": {\"first\":\"Christian\",\"last\":\"Schmitz\",\"city\":\"Nickenich\"}}]"; "addresses¶first"; 1 )

Example result: Christian

See also

Release notes

Blog Entries

This function checks for a license.

Created 27th January 2017, last changed 8th April 2024

JSON.GetArrayItemsAsQuickList - JSON.GetArraySize