APPEND
Use the APPEND function to join together items from two arrays.
Use
APPEND( array1, array2 )
Adds the items from the second array to the end of the first array.
| Parameter | Required | Description |
|---|---|---|
| array1 | Yes | an array (any type) that will have the items from array2 added to the end |
| array2 | Yes | an array (any type) who items will be added to the end of array1 |
| Returns | Array matching the type of array1 |
The APPEND function is used to join items from two arrays together, adding the contents of the second array to the end of the first array. The resulting array will match the data type of the first array parameter.
Here are two examples demonstrating how to use the APPEND function:
Examples
Combining Text Arrays
This example shows combining two separate arrays containing text values using the CREATE function to define the array literals:
| Function | Formula | Expected Result | Explanation |
|---|---|---|---|
| APPEND | APPEND(CREATE("A", "B"), CREATE("C", "D")) | {"A", "B", "C", "D"} | The text items from the second array, {"C", "D"}, are appended to the end of the first array, {"A", "B"}. |
Adding Values to an Existing Number Array
This example demonstrates appending new numbers (which typically use the Number data type) to an array retrieved from a previous step (represented here as @PreviousStep.out.Numbers):
| Function | Formula | Expected Result | Explanation |
|---|---|---|---|
| APPEND | APPEND(@PreviousStep.out.Numbers, CREATE(15, 25)) | {10, 20, 15, 25} | If @PreviousStep.out.Numbers contains {10, 20}, this formula uses the CREATE function to define new values which are then added to the end of the existing number array. |