Loop List

Loops through items in a list (comma, carriage return, or other delimited text). With each successive loop a block of steps is executed and the current index variable is updated with the next item in the list. The loop ends when at the end of the list or when a Break is encountered. To loop a block of steps through the records (rows) in a list (which is a variable containing multiple rows of data). With each loop the current record (row) in the list is incremented, until the last row is reached at which point the loop is ended.

Declaration

<AMLOOP TYPE="LIST" LIST="text(delimited list)" RESULTVARIABLE="text" DELIMITER="text(options)" SORT="text(options)">

See Also: Loop, End Loop, Loop Array, Loop Windows, Loop Expression, Loop Dataset, Loop List Control, Loop Tree Control

To set Loop List properties

  1. In the Available Actions pane, open the Loop folder and double-click the Loop List action or drag it into the Steps pane.

  2. In the List box, type or paste the list, type a variable name between percent signs (%), or click the percent sign (%) and use the Expression Builder to select a variable or create an expression. (The variable must be created in an earlier step using the Create Variable action.)

  3. In the Populate variable with list item box, select the variable to be populated with the list items.

  4. In the Delimiter box, select the delimiter used in the text list. If the delimiter is not on the drop-down list, select custom and then enter the delimiter in Use the following character(s) as delimiter(s) box.

  5. If you want to sort the list items alphabetically, click the Advanced tab and then select a sort order in the Output list box.

  6. To set the Description tab properties, refer to Description Tab Options.

  7. To set the Error Causes and On Error tab properties, refer to Step Error Handling.

  8. When finished, click OK to save settings and close the properties dialog box.

To auto-indent after all steps are added

  1. In the Steps pane, hold down SHIFT and click the first and last steps in the block so that the complete block of steps is selected.

  2. Click Format .

General Tab

Property

Type

Required

Default

Markup

Description

List

Text

Yes

(Empty)

LIST="Item1,Item2,Item3"

The list of data to Loop through. The List can be delimited by a variety of characters.

Populate variable with list item

Text

Yes

(Empty)

RESULTVARIABLE="varname"

The name of the variable to populate with the current list item. With each successive loop, this variable will be populated with the next item in the list.

Delimiter

Text (options)

No

Comma

DELIMITER="semi_colon"

Specifies the character that delimits the items in the list. The available options are:

  • Comma: The delimiter is a comma (Example: item1,item2,item3).

  • New line: The delimiter is a new line.

  • Semi colon: The delimiter is a semi colon (Example: item1;item2;item3).

  • Space: The delimiter is a space (Example: item1 item2 item3).

  • Tabulation: The delimiter is a tab character.

  • Custom: The delimiter is another character as specified (enter the desired character).

Attributes Tab

Property

Type

Required

Default

Markup

Description

Output List

Text (options)

No

Do not sort the list

SORT="ascending"

Specifies whether a sort order should be applied towards the list before the loop begins. The available options are:

  • Do not sort list (default)

  • Sort the list in ascending alphabetical order

  • Sort the list in descending alphabetical order

See Also

About Actions

Adding Task Steps