Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

JSON.GetArrayItem

Queries entry from array with given index.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
JSON 2.7 Yes Yes Yes Yes Yes

MBS( "JSON.GetArrayItem"; json; index { ; AsReference } )

Parameters

Parameter Description Example value
json A JSON text or reference. "[1,2,3]"
index The index of the array element. 0
AsReference Optional
Whether to return a reference number (1) instead of the JSON text (0).
Default is 0 for JSON text.
0

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

Example Databases


JSON.Format   -   JSON.GetArrayItemsAsList

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos