Choose where you’d like to start

For each index

Table of Contents

Overview

The for each index deluge task iterates through the index of all elements present in a list .

Syntax

for each index <loop_variable> in <list_variable>;
ParameterDescription
<loop_variable>

Variable to hold an individual element index for each iteration.

You can specify any variable name here, without having to declare it initially.

After the iteration, this variable will hold the index of the last element in the list.

<list_variable>

The list variable containing the elements which need to be iterated.

Data type is List.

This task can be used in the following events

When a record is Created
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Created or Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Deleted
On ValidateYes
On SuccessYes
Other workflow events
On a scheduled dateYes
During approval processYes
During payment processYes
In a Custom FunctionYes
In an Action item in reportYes

Example

The following code snippet displays the index number of each element along with the element name:

colorList = {"red", "green", "blue"};
for each index colorIndex in colorList
{
info "("+colorIndex+")"+colorList.get(colorIndex);
}

The output will be the following:
(0)red
(1)green
(2)blue

Get Started Now

Execute