> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape/working-with-field-transformations/available-transform-functions/string-transform-functions/concatenate-transform-function.md).

# Concatenate transform function

## Introduction

The **concatenate** transform function is used to join the values for two or more source fields (using a given joining character) and then map the output of this transformation to a destination field.

For example, you might have a source system that captures the `first name` and `last name` for customer records, and then a destination system that expects this information in a single `name` field.

## Adding a concatenate transform

In the instructions below, we'll step through the scenario mentioned above where our incoming payload includes the `first name` and `last name` for customer records, but our destination system expects this information in a single `full_name` field. The steps required are detailed in two stages:

* [Stage 1: Add all required source fields to the mapping row](#stage-1-add-all-required-source-fields-to-the-mapping-row)
* [Stage 2: Add a concatenate transform function](#stage-2-add-a-concatenate-transform-function)

### Stage 1: Add all required source fields to the mapping row

To begin, we need to update/add the required mapping row so that it includes all source fields that need to be joined and then pushed to the specified destination.

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

<div align="left"><figure><img src="/files/Hs6yKpWKHcg2UPukTlEk" alt="" width="325"><figcaption></figcaption></figure></div>

**Step 2**\
Find (or add) the mapping row which requires a concatenate transformation. In the example below, we have a row that's currently set to map the source `first name` field into the destination `full name` field:

<div align="left"><figure><img src="/files/ktiEje3c5FfPKzJ3wZbc" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 3**\
On the source side of the mapping row, we need to add all the fields that need to be joined. To do this, click the 'pencil' icon associated with the existing source field:

<div align="left"><figure><img src="/files/YKy2SgOWmwMsBpCxhgpA" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 4**\
Details for the selected field are shown - click the **add source field** button:

<div align="left"><figure><img src="/files/3qXM06OysRm9512gWNfu" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 5**\
Click the 'pencil' icon associated with the new source field:

<div align="left"><figure><img src="/files/Xvnxk0xWS4U44GarSJq0" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 6**\
Move down and update the **display name** and **payload** fields for the second source field that you want to join - for example:

<div align="left"><figure><img src="/files/JQq6dYrGlX1rImEcxvL0" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
In our example, our source data is coming in via a manual payload so are defining the payload field manually - if you're using a [connection shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md) to receive data, you'll be able to select the required field from the associated schema for your connection.
{% endhint %}

**Step 7**\
Accept these changes to exit back to your mapping rows - notice that there are now two source fields associated with the row you updated:

<div align="left"><figure><img src="/files/ITFhHp5J2UF2cFKSUYvp" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 8**\
Repeat steps 3 to 7 to add any more source fields that you need to join.

**Step 9**\
Go to [stage 2](#stage-2-add-a-concatenate-transform-function).

### Stage 2: Add a concatenate transform function

With all required source fields defined for our mapping row, we can add a **concatenate** transform function to join the values for these fields.

**Step 1**\
Select the **add transform** button for the required mapping rule - for example:

<div align="left"><figure><img src="/files/Z0MAAqkghzCJEBagiP26" alt="" width="563"><figcaption></figcaption></figure></div>

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

<div align="left"><figure><img src="/files/Pf33ofUOwYDQEMswCtcj" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 3**\
Click in the **name** field and select **concatenate** from the **string** section in the list of transform functions:

<div align="left"><figure><img src="/files/tiiE7UDqewZflbYeTBD9" alt="" width="563"><figcaption></figcaption></figure></div>

...**concatenate** options are displayed:

<div align="left"><figure><img src="/files/Sfj5bLQYdYrkpWYMvSfM" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 4**\
In the **join character** field, enter the character that you want to join each of your source fields - for example, a hyphen or a space:

<div align="left"><figure><img src="/files/3mMEYKbgIt6PUyavWBW2" alt="" width="563"><figcaption></figcaption></figure></div>

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

<div align="left"><figure><img src="/files/rSTghBkVBJB0nDq4msCf" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 6**\
Click in **source fields** and select the first source field to be joined:

<div align="left"><figure><img src="/files/SfrO3xtVXPYyEQMhjw0v" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
All source fields that were added for this mapping in [stage 1](#stage-1-add-all-required-source-fields-to-the-mapping-row) will be available for selection here.
{% endhint %}

**Step 7**\
Accept your changes.

**Step 8**\
Click the **add field** button again:

<div align="left"><figure><img src="/files/JJnep3kR3mrAa1xbU4dG" alt="" width="563"><figcaption></figcaption></figure></div>

...and add the next source field to be joined - for example:

<div align="left"><figure><img src="/files/6sOk4G9XeP0TRO1pcdU7" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 9**\
Accept your changes.

**Step 10**\
Repeat steps 8 and 9 to add any more source fields to be joined. Each time you accept a new source field you'll see the sequence that they will be processed when this transform function runs - for example:

<div align="left"><figure><img src="/files/34wCGkGYvBdNbneWA7Gv" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Fields are joined in the sequence that they are added here.
{% endhint %}

**Step 11**\
Having added all required source fields to be joined, accept changes:

<div align="left"><figure><img src="/files/tA5RIq0NFxjEEnm030kn" alt="" width="563"><figcaption></figcaption></figure></div>

...then save the function:

<div align="left"><figure><img src="/files/wALQWzeaE0sE5S4a9uvy" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 12**\
Ensure that the target field for this mapping row is set as required, then save the map shape. Next time the process flow runs, the given source fields for this mapping row will be joined and then that value is pushed to the target.\
\
The example below shows an incoming payload before and after the **concatenate** transformation is applied:

<div align="left"><figure><img src="/files/Z7rTHxkI4LXbJ4zJlyDU" alt=""><figcaption></figcaption></figure></div>
