# Array join transform function

## Introduction

The **array join** transform function is used to join elements of an array as a string, with a user-defined delimiter. For example, you might have product data in an array:

{% code lineNumbers="true" %}

```json
{
  "fruit_in": [
    "Apples",
    "Oranges",
    "Pears",
    "Grapes"
  ]
}
```

{% endcode %}

...and need to convert these items to a string before pushing to a single destination field (with each item in the string delimited by a character of your choice):

{% code lineNumbers="true" %}

```json
{"fruit_out":"Apples,Oranges,Pears,Grapes"}
```

{% endcode %}

## Adding an array join transform

**Step 1**\
In your process flow, access settings for your map shape:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FaXEkDoJIsEmKG9b1JSTu%2Fnull%20transform%201.png?alt=media&#x26;token=73b3cec9-ff2f-4ba8-8a9b-736cbac97f5f" alt="" width="274"><figcaption></figcaption></figure></div>

**Step 2**\
Select the **add transform** icon for the required mapping rule - for example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FB654ER7t1L9Dkc6bXyqO%2Farray%20join%20transform%20a1.png?alt=media&#x26;token=2aa8c195-d8be-49ec-932d-4faa196bb4b2" alt=""><figcaption></figcaption></figure></div>

**Step 3**\
Click the **add transform** button:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F3LdnN37gMP8KWtXcUgd5%2Farray%20join%20transform%201a.png?alt=media&#x26;token=ecf18911-c050-48cb-b11b-610a741459a1" alt=""><figcaption></figcaption></figure></div>

**Step 4**\
Click in the **name** field to access a list of all available transform functions, then select **join** from the **array** category:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FO5LsD0HUpzKaQqC9euMH%2Farray%20join%20transform%202.png?alt=media&#x26;token=879a7afb-5cf5-4c00-8bd2-58ed5bef439f" alt=""><figcaption></figcaption></figure></div>

**Step 5**\
In the delimiter field, enter the character that you want to use to delimit each array field in the string:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fe8WfQUWBVUPMM0WExo3I%2Farray%20join%20transform%203.png?alt=media&#x26;token=19bc068f-474a-4284-be51-7e25545e649c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
A space is a valid character. If you want to join array items with no spacing or other delimiters, leave this field empty.
{% endhint %}

**Step 6**\
Click the **add field** button:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FpGY7fOWG7Fu8c9LXQ6gm%2Farray%20join%20transform%204.png?alt=media&#x26;token=0235d33a-c928-4cff-9cb7-d6b7b9ec4b85" alt=""><figcaption></figcaption></figure></div>

**Step 7**\
Click in **source fields** and select the source field to be used for this transform:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FiKb0mDjrrr4WtwXSowH2%2Farray%20join%20transform%20a2.png?alt=media&#x26;token=02dbaac1-5181-41ec-a5c0-94d6c21401a0" alt=""><figcaption></figcaption></figure></div>

**Step 8**\
Accept your changes (twice).

**Step 9**\
Save the transform. You'll notice that the transform icon is updated to indicate that a transform function is present for the mapping row - for example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FdtP11Iq8V7vaqsgXbK7n%2Farray%20join%20transform%20a3.png?alt=media&#x26;token=ebd61562-fb82-4895-af41-83d274ba2911" alt=""><figcaption></figcaption></figure></div>

## Related pages

* [Mapping array fields](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape/mappings-tips-and-tricks/mapping-array-fields)
