---
schema_version: "1"
id: 120e5f2055a9ce9ceb2b7b8e8ea3384390e534e53d7c55516336d6284a4ffea0
title: ARRAY_TO_STRING
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/array-func/array-to-string.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-to-string.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b956c543b7385948d29764f24f5a5f5acec7ac45b4a547b3cffdab5a894987e8
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `ARRAY_TO_STRING`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Converts an array to a string using a separator and an optional null indicator.

## Syntax

```sql
array_to_string(<array>, <separator>[, null_string])
```

## Arguments

### Required

- `<array>`: The array to convert.
- `<separator>`: The delimiter to insert between elements.

### Optional

- `null_string`: The string to use for NULL elements.

## Returns

Returns a text value that contains all array elements joined by the separator. Without the optional `null_string` parameter, NULL elements are omitted from the output.

## Examples

### Basic Conversion

Convert an array to a semicolon-separated string.

```sql
SELECT array_to_string(array[1, 2, 3, NULL], ';') AS result;
```

Returns `'1;2;3'`, joining all elements with semicolons. The `NULL` element was ignored because no `NULL` value was specified.

### Handle NULL Elements

Convert an array with NULL values using a custom null indicator.

```sql
SELECT array_to_string(array[3, 2, 1, null], '-', 'N/A') AS result;
```

Returns `'3-2-1-N/A'`, replacing the NULL element with the specified indicator.

## Related Documentation

- [Array Data Type](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/array.md)
