Remove elements based on index
Overview
The remove index deluge task removes an element from a list based on a specified index, and returns that element.
Index refers to the position of elements in a list, and it starts from 0. So the index of the first element in the list will be 0, of the second element will be 1, and so on.
Syntax
<variable> = <list_variable>.remove(<index>);
Parameter | Description |
---|---|
<variable> (optional) | Variable which will contain the returned value. |
<list_variable> | The list variable from which an element has to be removed and returned. Data type is List. |
<index> | Index of the element which needs to be removed from the list and returned. Value should not be a negative number. If a negative number is specified, or the index is not found, a runtime error will be encountered. Value should not exceed the list size. Ideally, this limit will be list size minus 1, since index starts from 0. Data type is Number. |
This task can be used in the following events
When a record is Created | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Created or Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Deleted | ||
On Validate | Yes | |
On Success | Yes | |
Other workflow events | ||
On a scheduled date | Yes | |
During approval process | Yes | |
During payment process | Yes | |
In a Custom Function | Yes | |
In an Action item in report | Yes |
Example
The following snippet removes "Tuesday" from the "days" list.
days={"Monday", "Tuesday", "Wednesday", "Thursday", "Friday"};
days.remove( 1 );
days.remove( 1 );