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.GetArrayItems
Queries entries from JSON array.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| JSON | 10.4 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| json | A JSON text or reference. | "[1,2,3]" |
Result
Returns list or error.
Description
Queries entries from JSON array.Returns list of reference numbers for JSON objects.
Performance is better than FileMaker native once array is big enough.
Examples
Loop over JSON array items:
# get some huge JSON array
Set Variable [ $json ; Value: "[\"Hello\", \"World\"]" ]
# Create list of JSON reference numbers
Set Variable [ $list ; Value: MBS( "JSON.GetArrayItems"; $json ) ]
If [ MBS("IsError") = 0 ]
# loop over list
Set Variable [ $count ; Value: ValueCount($list) ]
If [ $count > 0 ]
Set Variable [ $index ; Value: 1 ]
If [ $index ≤ $count ]
Loop
# your script steps here
Set Variable [ $j ; Value: GetValue($list; $index) ]
Show Custom Dialog [ "JSON item" ; MBS("JSON.Format"; $j) ]
#
# next
Set Variable [ $index ; Value: $index + 1 ]
Exit Loop If [ $index > $count ]
End Loop
End If
End If
# free them all
Set Variable [ $r ; Value: MBS("JSON.Release"; $list) ]
End If
See also
- IsError
- JSON.Format
- JSON.GetArrayItem
- JSON.GetArrayItemsAsList
- JSON.GetArrayPathItems
- JSON.GetArraySize
- JSON.Release
Blog Entries
Release notes
- Version 10.4
- Added JSON.GetArrayItems function to work with huge JSON arrays.
- Version 8.3
- Fixed crash in JSON.GetArrayItemsAsList for undefined values.
- Version 8.1
- Added ReturnValues parameter for JSON.GetArrayItemsAsList function.
Created 22nd August 2020, last changed 22nd August 2020
JSON.GetArrayItem - JSON.GetArrayItemsAsList
Feedback: Report problem or ask question.
Links
MBS Xojo blog