> For the complete documentation index, see [llms.txt](https://documentation.siteglide.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.siteglide.com/developer-tools/zapier-integration/formatting-arrays-correctly.md).

# Formatting arrays correctly

## Background

When working with [Zapier](https://documentation.siteglide.com/developer-tools/zapier-integration.md), adding data to arrays needs some extra JavaScript to convert the data. Zapier calls arrays "Line Items" and formats them like so, `[123,456,789]` whereas Siteglide API expects a JavaScript formatted array such as, `[\"123\",\"456\",\"789\"]`.

To convert these two data types, use the screenshots and code below. In this example we are getting a pre-existing user and their Secure Zones, then adding in a new item.

## Zapier Setup

!\[Finding an individual user and retrieving their data]\(../../.gitbook/assets/archbee\_uploads/-AMxd0CRDYGkCslIGDgoD\_Screen Shot 2021-01-07 at 21.05.08.png)

![Finding an individual user and retrieving their data](https://584571746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ft7n2OYNNUr9PgpkBD2eX%2Fuploads%2Fgit-blob-7ddf68025c1d2a6409094cdc18ac1611f3c1bacf%2Ffind-individual-crm-user.png?alt=media)

!\[Pass that data into a "Run Javascript" action and run the following JavaScript]\(../../.gitbook/assets/archbee\_uploads/-AMxd0CRDYGkCslIGDgoD\_Screen Shot 2021-01-07 at 21.05.08.png)

```javascript
let data = inputData.sz.split(','); //Where sz is the name of the input data you picked above
let array = [];

data.forEach(item => array.push(item));
array.push("178375") //The ID of your secure zone

output = {output: JSON.stringify(array)};
```

!\[Pass the output of the "Run Javascript" action into the "Update User" action]\(../../.gitbook/assets/archbee\_uploads/z3nHyi\_3lNBW4Mbcl5b2n\_Screen Shot 2021-01-07 at 21.10.16.png)

The above javascript code and flow can be used for anywhere that you need to add an item to Line Items within Zapier.
