FunctionCopy link to clipboard
remove( array, index )
Removes the value at a given index from an array, and returns the resulting array.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Any Type Array |
The array to modify. |
|
Integer or Integer Array |
The one-based index or array of indices whose values should be removed. |
ReturnsCopy link to clipboard
Any Type Array
Usage considerationsCopy link to clipboard
Using the index parameterCopy link to clipboard
The index value must be greater than or equal to 1.
Understanding resultsCopy link to clipboard
Passing an empty array to the array parameter returns an empty array.
Passing an empty array to the index parameter returns the original array value.
ExamplesCopy link to clipboard
Remove one value from an arrayCopy link to clipboard
1
remove({10, 20, 30, 40}, 4)
Copy
Returns {10, 20, 30}
.
Remove multiple values from an arrayCopy link to clipboard
1
remove({10, 20, 30, 40}, {2, 4})
Copy
Returns {10, 30}
.
Remove the second to last item in an arrayCopy link to clipboard
1
2
3
4
a!localVariables(
local!list: { 1, 2, 3, null, 4 },
remove(local!list, count(local!list) - 1)
)
Copy
Returns {1, 2, 3, 4}
.
Remove CDTs from an array where a field matches a certain valueCopy link to clipboard
Note: These CDT values are for reference only. If you copy and paste this expression, it will not evaluate. Use this as a reference only.
1
2
3
4
5
6
7
8
9
10
a!localVariables(
local!customers: {
'type!{urn:com:appian:types:AS:FS}AS_FS_Customer'(customerId: 1),
'type!{urn:com:appian:types:AS:FS}AS_FS_Customer'(),
'type!{urn:com:appian:types:AS:FS}AS_FS_Customer'(customerId: 2),
'type!{urn:com:appian:types:AS:FS}AS_FS_Customer'()
},
local!newCustomers: wherecontains(tointeger(null), local!customers.customerId),
remove(local!customers, local!newCustomers)
)
Copy
Returns {'type!Customer'('customerId': 1), 'type!Customer'('customerId': 2)}
.'
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 | Compatible | |
Process Events | Compatible | |
Process Autoscaling | Compatible |