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

JSON.AddValueToObject

Adds a new entry to the object with the given name and value.

Component Version macOS Windows Linux Server iOS SDK
JSON 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "JSON.AddValueToObject"; json; Name...; Value... )   More

Parameters

Parameter Description Example
json A JSON text or reference. {"key": "value"}
Name... The name of the Object property. "length"
Value... The text value to add. "Hello

Result

Returns JSON code.

Description

Adds a new entry to the object with the given name and value.
Same as JSON.AddItemToObject, but calls JSON.CreateString or JSON.CreateNumber automatically for you.

This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat Name and Value parameters as often as you need.

Examples

Add values to an object:

MBS( "JSON.AddValueToObject"; "{}"; "Hello"; "World"; "test"; 123; "a"; "abc")

Example result:
{ "Hello": "World", "test": 123, "a": "abc" }

See also

Release notes

Blog Entries

This function checks for a license.

Created 20th February 2024, last changed 20th February 2024


JSON.AddValueToArray - JSON.Clone