---
schema_version: "1"
id: 0e0932c00e7eb6bc46c92b53f77d5b7b2b7998b675bc43d11f57599b91b50d75
title: ARRAY_APPEND
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-append.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-append.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d267c1361e9ee8d2322ee5678d32792829319e14844bb9d79bc06e5d882dc188
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `ARRAY_APPEND`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Inserts a value at the end of an array.

## Syntax

```sql
array_append(<array>, <value>)
```

## Arguments

### Required

- `<array>`: The array to append to.
- `<value>`: The value to insert at the end. The value must be NULL or match array element type, otherwise your SQL query will fail. Appending NULL changes the array element type to nullable.

## Returns

Returns an array with the new value inserted at the end.

## Examples

### Append a Value

Add a value to the end of an array.

```sql
SELECT array_append(array[1, 2, 3], 4) AS result;
```

Returns `array[1, 2, 3, 4]`, with 4 added at the end.

### Append NULL

Add a NULL value to the end of an array.

```sql
SELECT array_append(array[1, 2, 3], null) AS result;
```

Returns `array[1, 2, 3, null]`. Appending NULL to an array with a non-nullable element type changes the resulting element type to nullable.

## Related Documentation

- [Array Data Type](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/array.md)
