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:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
JSON.GetArrayPathItems
Queries value from JSON path in array of objects.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| JSON | 7.1 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| 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. |
"people¶0¶last" | |
| AsValue | Pass 1 to return as value, e.g. text or number. Pass 0 (or nothing) to return as JSON. |
Optional |
Result
Returns OK or error.
Description
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.
Examples
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
See also
Blog Entries
Release notes
- Version 7.1
- Added JSON.GetArrayPathItems function.
Created 27th January 2017, last changed 28th June 2017
JSON.GetArrayItemsAsList - JSON.GetArraySize
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins