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: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

JSON.Flatten

Flattens a json object or array to a single depth object of key-value pairs.

Component Version macOS Windows Linux Server iOS SDK
JSON 13.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "JSON.Flatten"; json )   More

Parameters

Parameter Description Example
json A JSON text or reference.

Result

Returns JSON or error.

Description

Flattens a json object or array to a single depth object of key-value pairs.
The keys in the flattened object are normalized json paths. The values are primitive (string, number, boolean, or null), empty object ({}) or empty array ([]).

Examples

Try it:

MBS( "JSON.Flatten"; "{\"test\": 123}" )

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

See also

This function checks for a license.

Created 18th September 2023, last changed 18th September 2023


JSON.FindValueInObjectArray - JSON.Format

💬 Ask a question or report a problem