Free cookie consent management tool by TermsFeed insert() Function
insert() Function

Function

insert( array, value, index )

Inserts a value into the given array and returns 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 insert.

index

Integer or Integer Array

The index or array of indices at which the value should be inserted.

Returns

Any Type Array

Usage considerations

An index value less than 1 appends the value to the left-side of the array, and an index value greater than the array length appends the value to the right-side of the array.

Examples

insert({10, 20, 30, 40}, 100, 1) returns 100, 10, 20, 30, 40

insert({10, 20, 30, 40}, 100, 5) returns 10, 20, 30, 40, 100

insert({10, 20, 30, 40}, {100, 200}, 1) returns 100, 200, 10, 20, 30, 40

insert({10, 20, 30, 40}, 100, {1, 2}) returns 100, 10, 100, 20, 30, 40

insert({10, 20, 30, 40}, {100, 200}, {1, 2}) returns 100, 10, 200, 20, 30, 40

Feature compatibility

The table below lists this function's compatibility with various features in Appian.
Feature Compatibility Note
Portals Compatible
Offline Mobile Compatible
Custom Record Field Expressions Compatible
Process Reports Compatible
Process Events Compatible
Open in Github Built: Mon, Apr 22, 2024 (07:48:53 PM)

insert() Function

FEEDBACK