Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Farray%2Farrayconcat.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Farray%2Farrayconcat.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `arrayConcat`

## Description

Returns a new array by concatenating the elements of two arrays into a single array.

* Both arrays must be of the same element type.
* Supported element types include `string`, `bool`, `number`, `interval`, `timestamp`, `regexp`, and `enum`.

## Syntax

Like many functions in DataPrime, `arrayConcat` supports<!-- --> [two notations](https://docs-docusaurus.kinsta.page/dataprime/language-reference/functions-reference/.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
arrayConcat(array1: array<T>, array2: array<T>): array<T>
```

```
(array1: array<T>).arrayConcat(array2: array<T>): array<T>
```

## Arguments

| Name     | Type       | Required | Description                 |
| -------- | ---------- | -------- | --------------------------- |
| `array1` | `array<T>` | **true** | The first array to combine  |
| `array2` | `array<T>` | **true** | The second array to combine |

## Example

**Use case: Combine job queues into a single view**

Suppose you want to view both processing and loading jobs in a single list. Consider the following input:

```
{

    "processing_jobs_waiting": ["job1", "job2", "job3"],

    "loading_jobs_waiting": ["loading_job1", "loading_job2", "loading_job3"]

}
```

By concatenating the arrays, you can see all jobs together in one array for simplified analysis.

### Example query

* Function notation
* Method notation

```
create all_jobs from arrayConcat(processing_jobs_waiting, loading_jobs_waiting)
```

```
create all_jobs from processing_jobs_waiting.arrayConcat(loading_jobs_waiting)
```

### Example output

The result will combine both arrays:

```
{

    "processing_jobs_waiting": ["job1", "job2", "job3"],

    "loading_jobs_waiting": ["loading_job1", "loading_job2", "loading_job3"],

    "all_jobs": ["job1", "job2", "job3", "loading_job1", "loading_job2", "loading_job3"]

}
```
