JSON.AddValueToObject
---------------------

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

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [JSON](component_JSON.md) | [14.1](newinversion141.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "JSON.AddValueToObject"; JSON; Name...; Value... ) 

**MBS**( **"JSON.AddValueToObject";** /\* Adds a new entry to the object with the given name and value. \*/  
**$JSON**; /\* A JSON text or reference.e.g. {"key": "value"} \*/   
**$Name...**; /\* The name of the Object property.e.g. "length" \*/   
**$Value...**) /\* The text value to add.e.g. "Hello \*/ 

### 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](JSONAddItemToObject.md), but calls [JSON.CreateString](JSONCreateString.md) or [JSON.CreateNumber](JSONCreateNumber.md) 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")  
<small>  
Example result:   
{ "Hello" : "World" , "test" : 123 , "a" : "abc" } </small>### See also

- [JSON.AddBooleanToObject](JSONAddBooleanToObject.md)
- [JSON.AddFalseToObject](JSONAddFalseToObject.md)
- [JSON.AddItemToObject](JSONAddItemToObject.md)
- [JSON.AddNullToObject](JSONAddNullToObject.md)
- [JSON.AddNumberToObject](JSONAddNumberToObject.md)
- [JSON.AddStringToObject](JSONAddStringToObject.md)
- [JSON.AddTrueToObject](JSONAddTrueToObject.md)
- [JSON.CreateNumber](JSONCreateNumber.md)
- [JSON.CreateString](JSONCreateString.md)

### Release notes

- **Version 16.2**
    - Changed [JSON.AddValueToObject](https://www.mbsplugins.eu/JSONAddValueToObject.shtml), [JSON.AddItemToObject](https://www.mbsplugins.eu/JSONAddItemToObject.shtml) and [JSON.AddNumberToObject](https://www.mbsplugins.eu/JSONAddNumberToObject.shtml) to replace existing items instead of adding a duplicate.
- **Version 14.1**
    - Added [JSON.AddValueToArray](https://www.mbsplugins.eu/JSONAddValueToArray.shtml) and [JSON.AddValueToObject](https://www.mbsplugins.eu/JSONAddValueToObject.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 16.2pr5](https://www.mbsplugins.de/archive/2026-05-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 14.1](https://www.mbsplugins.de/archive/2024-03-19/New_in_MBS_FileMaker_Plugin_14/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 14.1 für Claris FileMaker](https://www.mbsplugins.de/archive/2024-03-12/Neues_MBS_Plugin_141_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 14.1 for Claris FileMaker](https://www.mbsplugins.de/archive/2024-03-12/MBS_Plugin_141_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.1pr4](https://www.mbsplugins.de/archive/2024-02-26/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[JSON.AddValueToArray](JSONAddValueToArray.md) - [JSON.ArraySlice](JSONArraySlice.md)

[HTML Version](JSONAddValueToObject.shtml)