1. Docs
  2. Formulas
  3. Functions

INSERT

Inserts an item into an array at a given index.

Categories: Arrays

Syntax

INSERT(array, index, item)

Examples

Example 1

Formula

INSERT(["a", "b", "c"], 1, "x")

Output

1
[
2
"a",
3
"x",
4
"b",
5
"c"
6
]

Example 2: Accepts negative indexes.

Formula

INSERT(["a", "b", "c"], -2, "x")

Output

1
[
2
"a",
3
"b",
4
"x",
5
"c"
6
]
Was this helpful?