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

JSON.AddValueToArray

Adds a value to an array.

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

Parameters

Parameter Description Example
json A JSON text or reference. ["1","2"]
Value... The new text. "Hello"

Result

Returns JSON code.

Description

Adds a value to an array.
Same as JSON.AddItemToArray, but calls JSON.CreateString or JSON.CreateNumber automatically for you.

When adding to a JSON reference, the function returns that reference number.

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

Examples

Add values to an array:

MBS( "JSON.AddValueToArray"; "[]"; 1; 2; 3; "Hello"; true )

Example result:
[1, 2, 3, "Hello", 1]

See also

Release notes

Blog Entries

This function checks for a license.

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


JSON.AddTrueToObject - JSON.AddValueToObject