---
title: Concat Function
description: See how to use the Concat function
documentId: ipaas-legacy-concat
locale: en-US
---

The **Concat** function joins (concatenates) multiple values into a single character sequence (*string*):

```
concat (field 1, field 2,...)
```

This function is widely used to create texts by combining literal variables or values from other operations.

In Sensedia Integrations, the Concat function is available for:

* [REST API connector data mapping (*Data Mapping*)](/docs/integrations/ipaas-legacy-connectors-rest-api#data-mapping)
* [*Expression Builder*](docs/integrations/ipaas-legacy-expression-builder)
* Assembling instructions for technical connectors (databases, cloud providers, and ERP systems)

**Example 1**

Consider an integration with a *step* that generates a sales report.
The goal is to create a message with the total units sold in 2023.
For example:

* **In 2023, total sales of 5000 units.**

To create the message, we will use:

* The *payload* from a connector available in **Properties**: `$.Sales.Response.Payload.totalSales`.
* **Strings**: represented between double quotes:
  * `"_In_"`, `"_total sales of_"`, `"_units_"`
  * `" "` (blank space)
  * `","` (including comma as text).
* **Separators**: the comma separates the elements or fields to be concatenated.
* **Numbers**: 2023 (not placed in quotes).

Thus, we have the Concat function:

```
concat("In"," ", 2023,",","total sales of"," ",$.Sales.Response.Payload.totalSales," ", "units.")
```

**Example 2**

Consider an integration that contains a SQL database connector:

<Callout type="important" title="IMPORTANT">
To assemble SQL database instructions, you must use [SQL syntax](/docs/integrations/ipaas-legacy-sql-instructions).
</Callout>

The SQL statement below selects all columns from a table only for the record where the `id` field value matches the `id` field value provided in the specified *payload*.

```
concat("SELECT * FROM clients WHERE id = ", $.clientRegistration.Response.Payload.id)
```

See the step-by-step of the instruction:

- `"SELECT * FROM clients WHERE id = "`: instructs the database to:
  - Select (`SELECT`)
  - all columns (`*`)
  - from (`FROM`)
  - the `clients` table
  - and filter the search (`WHERE`)
  - to return only the record where the `id` column matches a specific value indicated after the equals sign (`id =`).
  - `$.clientRegistration.Response.Payload.id`: value that will be filtered by the instruction, extracted from the `id` field in the response *payload* of the `clientRegistration` connector.

Now, the value of the `id` field will be a fixed value equal to `155`.

```
concat("SELECT * FROM clients WHERE id = ", 155)
```

This means that the instruction will return all columns from the `clients` table for the record whose `id` is 155.
