Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

JSON.AddBooleanToObject

Adds a boolean value to an array.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
JSON 6.0 Yes Yes Yes Yes Yes

MBS( "JSON.AddBooleanToObject"; json; name; value )

Parameters

Parameter Description Example value
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.
1

Result

Returns JSON code or error.

Description

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.

Examples

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


IsWindows   -   JSON.AddFalseToObject

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins