APPEND

Description

APPEND returns a new list with a single element added to the end. Unlike CONCAT, 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:

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

Last updated

Was this helpful?