insert( array, value, index )
Inserts a value into the given array and returns the resulting array.
Keyword | Type | Description |
---|---|---|
|
Any Type Array |
The array to modify. |
|
Any Type or Any Type Array |
The value or values to insert. |
|
Integer or Integer Array |
The index or array of indices at which the value should be inserted. |
Any Type Array
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.
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 | 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 | |
Process Reports | Compatible | |
Process Events | Compatible |
insert() Function