Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
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 |
Parameter | Description | Example | Flags |
---|---|---|---|
json | A JSON text or reference. If that is not an array, the function returns an empty result. |
"[{\"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. |
"last" | |
AsValue | Pass 1 to return as value, e.g. text or number. Pass 0 (or nothing) to return as JSON. |
Optional |
Returns value or error.
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:
"Christian"
"Peter"
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:
Christian
Peter
This function checks for a license.
Created 27th January 2017, last changed 9th November 2021