Data Record Loop Index

Block Information

Available in: Page Flow and Cloud Flow

Toolbox Category: Data

Block Type: Output

Output Type: numeric

Data Record Loop Index is an output block that provides the zero-based index of the current iteration of the Data Record Loop block, when used inside the Tasks Flow Parameter. The output is of type numeric and is compatible with Value Parameters of type numeric or of type any.

NOTE: This block will provide valid values when used inside the Tasks Flow Parameter of the Data Record Loop block.

Usage Example

NOTE: Please refer to the prerequisite information shown here before seeing the example.

The image below shows an example of the Data Record Loop Index block. This example incorporates the Usage Example function, as outlined in the Database Reading Logic for examples section on the prerequisite information page mentioned above.

Here is a summary of the above example:

  • The Data Record Loop block is used with the Customers Database Table and the dataset name of ds1 are as Value Parameters .

  • For each iteration inside the Tasks Flow Parameter, we use the Write Log Message block to log the current iteration index combined with the customer's email address by accessing the EmailAddress field of each record.

  • The Data Record Loop Index block is used to get the current iteration index.

  • To access information about the record, we use the Data Record Info block.

The result for the above example can be seen in the browser's web console, and a sample is shown below (Note the zero-based index):

[LOG(info) 08/29/2023 14:40:12.682] Index:  0 Email:
[LOG(info) 08/29/2023 14:40:12.683] Index:  1 Email:
[LOG(info) 08/29/2023 14:40:12.684] Index:  2 Email:
[LOG(info) 08/29/2023 14:40:12.684] Index:  3 Email:

Last updated