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

# `arrayJoin`

## Description

Returns a single string by joining the elements of an array using the specified delimiter.

* The element type must be compatible with string conversion.
* Supported element types include `string`, `bool`, `number`, `interval`, `timestamp`, `regexp`, and `enum`.

## Syntax

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

* Function notation
* Method notation

```
arrayJoin(array: array<T>, delimiter: string): string
```

```
(array: array<T>).arrayJoin(delimiter: string): string
```

## Arguments

| Name        | Type       | Required | Description                                          |
| ----------- | ---------- | -------- | ---------------------------------------------------- |
| `array`     | `array<T>` | **true** | The array of values to join                          |
| `delimiter` | `string`   | **true** | The string delimiter used to join the array elements |

## Example

**Use case: Build a readable message from array values**

Suppose you have a list of users who logged in. Consider the following input:

```
{

    "users": ["Chip", "Ruby", "Glitch", "Cora"],

    "action": "LOGIN"

}
```

By joining the `users` array with a delimiter, you can generate a human-readable string that combines the array elements with other fields.

### Example query

* Function notation
* Method notation

```
create msg from `Users {arrayJoin(users, ',')} performed action {action}`
```

```
create msg from `Users {users.arrayJoin(',')} performed action {action}`
```

### Example output

The result will include a new field `msg` with the joined string:

```
{

    "users": ["Chip", "Ruby", "Glitch", "Cora"],

    "action": "LOGIN",

    "msg": "Users Chip,Ruby,Glitch,Cora performed action LOGIN"

}
```
