Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Filters JSON object array to find matching entries.

Component Version macOS Windows Linux Server iOS SDK
JSON 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "JSON.FilterObjectArray"; json; Label; find { ; byContent } )   More


Parameter Description Example Flags
json A JSON text or reference. "[{\"key\": 1}]"
Label The label for the value in the object to compare. "key"
find A JSON text or reference to find. 1
byContent Compare JSON by content, so number can be found via text.
Default is 0, so type counts first.
1 Optional


Returns JSON or error.


Filters JSON object array to find matching entries.
Similar as if you loop and look for index of matching items with JSON.FindValueInObjectArray and transfer it yourself to a new array.


Try it:

MBS( "JSON.FilterObjectArray"; "[{\"test\":12}, {\"test\":123}]"; "test"; 123 )

Example result:
[ { "test": 123 } ]

Try with string:

MBS( "JSON.FilterObjectArray";
"[ {\"test\":\"abc\", \"ID\": 1}, {\"test\":\"Hello\", \"ID\": 2} ]";
"test"; "\"Hello\"" )

Example result:
[ { "test": "Hello", "ID": 2 } ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 26th May 2023, last changed 18th July 2023

JSON.Equals - JSON.FindValueInArray

💬 Ask a question or report a problem