FunctionCopy link to clipboard
append( array, value )
Appends a value or values to the given array, and returns the resulting array.
See also:
- insert(): Use this function to add items to the beginning or middle of an array.
- joinarray(): Use this function to insert a string element between each item in the resulting array.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Any Type Array |
The array to modify. |
|
Any Type or Any Type Array |
The value or values to append. |
ReturnsCopy link to clipboard
Any Type Array
Usage considerationsCopy link to clipboard
Data types of array itemsCopy link to clipboard
The array to be modified can contain items of one or more types. When all array items are a single type, the value must be the same type as the current items in the array. The updated array will be a List of that type. For example, append({10, 20}, 30)
returns 10, 20, 30
, a List of Number (Integer).
Any values that are not the same type will not be added. For example, append({10, 20, 30, 40}, "fifty")
returns 10, 20, 30, 40, null
because the text value ("fifty"
) cannot be added to an array of numbers.
An array with values of more than one type returns a List of Variant. For example, append({10, "twenty"}, 30)
returns 10, "twenty", 30
.
You can append values of any type to these mixed-type arrays. For example, append({10, "twenty"}, 30.15)
returns 10, "twenty", 30.15
, a list of variant types with an integer, text string, and decimal.
ExamplesCopy link to clipboard
Append one item to an array of one typeCopy link to clipboard
1
2
3
4
append(
{10, 20, 30, 40},
50
)
Copy
Returns {10, 20, 30, 40, 50}
. When the array contains items of one type, the value must be the same type.
If value is not the same type, a null is appended. For example:
1
2
3
4
append(
{10, 20, 30, 40},
"fifty"
)
Copy
Returns {10, 20, 30, 40, null}
because the text value cannot be added to an array of numbers.
Append an array to an empty arrayCopy link to clipboard
1
2
3
4
append(
{},
{60, 70}
)
Copy
Returns {60, 70}
.
Append one array to anotherCopy link to clipboard
1
2
3
4
append(
{10, 20, 30, 40},
{50, 60, 70}
)
Copy
Returns {10, 20, 30, 40, 50, 60, 70}
.
Append multiple arraysCopy link to clipboard
1
2
3
4
5
append(
{"Red", "Green"},
{"Blue", "Yellow"},
{"Brown", "White"}
)
Copy
Returns {"Red", "Green", "Blue", "Yellow", "Brown", "White"}
.
Append decimal numbers to an integer arrayCopy link to clipboard
When appending a Number (Decimal) value to an array of Number (Integer), Appian will round the decimal value to the nearest integer.
1
2
3
4
append(
{10, 20},
30.49
)
Copy
Returns {10, 20, 30}
.
1
2
3
4
append(
{10, 20},
30.5
)
Copy
Returns {10, 20, 31}
.
Feature compatibilityCopy link to clipboard
The table below lists this function's compatibility with various features in Appian.
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Compatible | Can be used to create a custom record field that only evaluates at sync time. |
Real-Time Custom Record Fields | Incompatible | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Incompatible | Cannot be used to configure a process report. |
Process Events | Incompatible | Cannot be used to configure a process event node, such as a start event or timer event. |
Process Autoscaling | Compatible |