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.FindValueInArray
Queries index of value in array.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| JSON | 9.0 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| json | A JSON text or reference. | {"key": "value"} | |
| find | A JSON text or reference to find. | {"key": "value"} | |
| byContent | Compare JSON by content, so number can be found via text. Default is 0, so type counts first. |
1 | Optional |
Result
Returns index or error.
Description
Queries index of value in array.Returns zero based index or -1 if not found.
Version 10.0 or newer finds optionally by content, so number can be found via text.
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
- MBS FileMaker Plugin, version 10.0pr8
- With JSON in excellent form
- MBS FileMaker Plugin, version 8.6pr4
FileMaker Magazin
Release notes
- Version 10.0
- Added parameter to JSON.FindValueInArray and JSON.FindValueInObjectArray to compare by content.
- Version 9.0
- Added JSON.CreateValue, JSON.Equals, JSON.FindValueInArray and JSON.FindValueInObjectArray functions.
Created 14th December 2018, last changed 10th January 2020
JSON.Equals - JSON.FindValueInObjectArray
Feedback: Report problem or ask question.
Links
MBS FileMaker blog