JSON.AddValueToArray
--------------------

Adds a value to an array.

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

MBS( "JSON.AddValueToArray"; JSON; Value... ) 

**MBS**( **"JSON.AddValueToArray";** /\* Adds a value to an array. \*/  
**$JSON**; /\* A JSON text or reference.e.g. \["1","2"\] \*/   
**$Value...**) /\* The new text.e.g. "Hello" \*/ 

### 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](JSONAddItemToArray.md), but calls [JSON.CreateString](JSONCreateString.md) or [JSON.CreateNumber](JSONCreateNumber.md) 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 )  
<small>  
Example result:   
\[1 , 2 , 3 , "Hello" , 1 \] </small>### See also

- [JSON.AddArrayToArray](JSONAddArrayToArray.md)
- [JSON.AddItemToArray](JSONAddItemToArray.md)
- [JSON.AddNumberToArray](JSONAddNumberToArray.md)
- [JSON.CreateNumber](JSONCreateNumber.md)
- [JSON.CreateString](JSONCreateString.md)
- [JSON.FindValueInArray](JSONFindValueInArray.md)

### Release notes

- **Version 14.1**
    - Added [JSON.AddValueToArray](https://www.mbsplugins.eu/JSONAddValueToArray.shtml) and [JSON.AddValueToObject](https://www.mbsplugins.eu/JSONAddValueToObject.shtml) functions.

### Blog Entries

- [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.AddTrueToObject](JSONAddTrueToObject.md) - [JSON.AddValueToObject](JSONAddValueToObject.md)

[HTML Version](JSONAddValueToArray.shtml)