Free cookie consent management tool by TermsFeed

append() Function

Function

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.

Parameters

Keyword Type Description

array

Any Type Array

The array to modify.

value

Any Type or Any Type Array

The value or values to append.

Returns

Any Type Array

Usage considerations

Data types of array items

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.

Examples

Append one item to an array of one type

1
2
3
4
append(
  {10, 20, 30, 40},
  50
)

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"
)

Returns {10, 20, 30, 40, null} because the text value cannot be added to an array of numbers.

Append an array to an empty array

1
2
3
4
append(
  {},
  {60, 70}
)

Returns {60, 70}.

Append one array to another

1
2
3
4
append(
  {10, 20, 30, 40},
  {50, 60, 70}
)

Returns {10, 20, 30, 40, 50, 60, 70}.

Append multiple arrays

1
2
3
4
5
append(
  {"Red", "Green"},
  {"Blue", "Yellow"},
  {"Brown", "White"}
)

Returns {"Red", "Green", "Blue", "Yellow", "Brown", "White"}.

Append decimal numbers to an integer array

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
)

Returns {10, 20, 30}.

1
2
3
4
append(
  {10, 20},
  30.5
)

Returns {10, 20, 31}.

Feature compatibility

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.

Feedback