Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
JSON.GetArrayItem
Queries entry from array with given index.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
JSON | 2.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "JSON.GetArrayItem"; json; index { ; Flags } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
json | A JSON text or reference. | "[1,2,3]" | |
index | The index of the array element. | 0 | |
Flags | Pass various flags. 0 returns as JSON text. 1 returns as JSON reference number. 2 returns as value. Default is 0. |
0 | Optional |
Result
Returns JSON code.
Description
Queries entry from array with given index.Index is zero based.
Examples
Create array and pick second item:
Let(
[
j = MBS( "JSON.CreateDoubleArray"; 1; 2; 3);
r = MBS( "JSON.GetArrayItem"; j; 1 )
];
r)
See also
- FM.SQL.JSONRecords
- JSON.CreateDoubleArray
- JSON.GetArrayItems
- JSON.GetArrayItemsAsList
- JSON.GetArrayItemsAsQuickList
- JSON.GetArrayPathItems
- JSON.GetArraySize
- QuickList.JoinJSON
- XML.ItemRefs
Release notes
- Version 14.4
- Changed JSON.GetArrayItemsAsList to return empty result if JSON is empty.
- Version 13.3
- Added JSON.GetArrayItemsAsQuickList and QuickList.JoinJSON functions.
- Version 10.5
- Added flags for JSON.GetArrayItem, so result can be JSON, reference or now value.
- 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.
Example Databases
- Barcode/Swiss QR-Code for invoices/Swiss QR-Code for invoices ISO 20022
- CURL/Email/IMAP Email List
- CURL/Email/IMAP Email
- CURL/MQTT
- CURL/WebServices/WeatherBit.io test
- JSON/JSON Order Parsing
- JSON/JSON Test
- Mac and iOS/Data Detector
- Mac only/ImageCapture/Camera Import
- Win Only/WindowsML
Blog Entries
- MQTT in FileMaker
- MBS FileMaker Plugin, version 10.5pr1
- With JSON in excellent form
- Face detection via CoreImage in FileMaker
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 27th September 2020