# APPEND

### Description

`APPEND` returns a new list with a single element added to the end. Unlike [`CONCAT`](/rule-language/operators/string-operators/concat.md), which merges two lists together, `APPEND` takes an existing list and a single value and returns a new list containing all original elements followed by that value. The original list is not mutated.

### Syntax

```
APPEND(list, element)
```

**Returns:** A new list with `element` appended.

### Example

```
APPEND(['a', 'b', 'c'], 'd')
```

This returns `['a', 'b', 'c', 'd']`.

### Difference from CONCAT

`CONCAT` merges two lists:

```
CONCAT(['a', 'b'], ['c', 'd'])
```

Returns `['a', 'b', 'c', 'd']`.

`APPEND` adds a single element, not a list:

```
APPEND(['a', 'b'], 'c')
```

Returns `['a', 'b', 'c']`.

If you pass a list as the element to `APPEND`, it will be added as a nested list, not merged:

```
APPEND(['a', 'b'], ['c', 'd'])
```

Returns `['a', 'b', ['c', 'd']]`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/list-operators/append.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
