JSON.AddStringToArray
---------------------

Adds a string to an array.

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

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

**MBS**( **"JSON.AddStringToArray";** /\* Adds a string 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 string to an array.  
Same as [JSON.AddItemToArray](JSONAddItemToArray.md), but calls [JSON.CreateString](JSONCreateString.md) 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 Value parameter as often as you need.  
### Examples

Adds a string to an array:

 MBS ( "JSON.AddStringToArray"; "\[\\"1\\",\\"2\\",\\"3\\"\]"; "4")  
<small>  
Example result:   
\["1" , "2" , "3" , "4" \] </small>Adds 4 strings to an array:

 MBS ( "JSON.AddStringToArray"; "\[\]"; "1"; "2"; "3"; "4" )  
<small>  
Example result:   
\["1" , "2" , "3" , "4" \] </small>### See also

- [JSON.AddArrayToArray](JSONAddArrayToArray.md)
- [JSON.AddItemToArray](JSONAddItemToArray.md)
- [JSON.AddNumberToArray](JSONAddNumberToArray.md)
- [JSON.AddStringToObject](JSONAddStringToObject.md)
- [JSON.CreateArrayRef](JSONCreateArrayRef.md)
- [JSON.CreateString](JSONCreateString.md)

### Blog Entries

- [Data structures in MBS Plugin](https://www.mbsplugins.de/archive/2023-11-27/Data_structures_in_MBS_Plugin/monkeybreadsoftware_blog_filemaker)
- [News about the MBS FileMaker Plugin 10.2](https://www.mbsplugins.de/archive/2020-05-19/News_about_the_MBS_FileMaker_P/monkeybreadsoftware_blog_filemaker)
- [With JSON in excellent form](https://www.mbsplugins.de/archive/2019-11-16/With_JSON_in_excellent_form/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.3pr8](https://www.mbsplugins.de/archive/2014-09-02/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2020, Seite 17](https://filemaker-magazin.de/neuigkeit/4110-Appetithappen-FMM_202005)

This function checks for a license.

Created 26th August 2014 , last changed 5th June 2021

  
[JSON.AddNumberToObject](JSONAddNumberToObject.md) - [JSON.AddStringToObject](JSONAddStringToObject.md)

[HTML Version](JSONAddStringToArray.shtml)