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: 10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  


Adds a boolean value to an array.

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


Parameter Description Example
json A JSON text or reference. [false,true,false]
Name... The name of the key. "Hello"
Value... The boolean to be added.
Pass 1 for true and 0 for false.


Returns JSON code or error.


Adds a boolean value to an array.
Same as JSON.AddItemToArray, but calls JSON.CreateBoolean automatically for you.

With version 6, you can pass several parameters to add several entries to the array.
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 Name and Value parameters as often as you need.


Add a boolean to object:

Set Variable [$json; Value:MBS( "JSON.Parse"; "{\"Hello\": \"World\"}" )]
Set Variable [$json; Value:MBS( "JSON.AddBooleanToObject"; $json; "test"; 1)]
Show Custom Dialog [$json; MBS("JSON.Format"; $json)]
Set Variable [$r; Value:MBS( "JSON.Release"; $json)]

Add a value:

MBS( "JSON.AddBooleanToObject"; "{}"; "test"; 1 )

Example result:
  "test":   true

See also

Blog Entries

FileMaker Magazin

Created 5th January 2016, last changed 5th June 2021

JSON.AddArrayToArray - JSON.AddFalseToObject

Feedback: Report problem or ask question.

MBS Xojo blog

Start Chat