Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3    Statistic  

JSON.FindValueInArray

Queries index of value in array.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
JSON 9.0 Yes Yes Yes Yes Yes
MBS( "JSON.FindValueInArray"; json; find )   More

Parameters

Parameter Description Example value
json A JSON text or reference. {"key": "value"}
find A JSON text or reference to find. {"key": "value"}

Result

Returns index or error.

Description

Queries index of value in array.
Returns zero based index or -1 if not found.

Examples

Find value in an array of numbers:

MBS( "JSON.FindValueInArray"; "[5,6,7,1,4,3,7]"; 3)

Example result: 5

Find text:

MBS( "JSON.FindValueInArray"; "[\"Hello\", \"World\", \"Test\"]"; "\"World\"")

Example result: 1

Find objects:

MBS( "JSON.FindValueInArray"; "[{\"Hello\":123}, {\"World\":234}, {\"Test\":345}]"; "{\"World\":234}")

Example result: 1

See also

Blog Entries

Created 14th December 2018, last changed 14th December 2018


JSON.Equals   -   JSON.FindValueInObjectArray

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins