Loop List Action
LIST="text [list]" RESULTVARIABLE="text [varname]"
DELIMITER="text [options]" SORT="text [options]">
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.
Specifies a list of data to Loop through. The List can be delimited by a variety of characters.
Specifies 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.
Specifies the character that delimits the items in the list.
The available options are:
comma: The delimiter is a comma (e.g. item1,item2,item3).
new_line: The delimiter is a new line.
semi_colon: The delimiter is a semi colon (e.g. item1;item2;item3).
space: The delimiter is a space (e.g. item1 item2 item3).
tabulation: The delimiter is a tab character.
(custom): The delimiter is another character as specified (simply enter the desired character).
Specifies whether a sort order should be applied to the values before the loop begins. For example, selecting "ascending" would return the list items in alphabetical order.
The available options are:
none: The results are left in their natural order and not sorted.
ascending: The results sorted in ascending alphabetical order.
descending: The results sorted in descending alphabetical order.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.
More on variables
More on expressions
More on the expression builder
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<AMLOOPLIST LIST="%thenames%" RESULTVARIABLE="currentitem">
<!--- This task shows reading in a file with multiple
lines. Each line of the file is treated as a list item. To use it, you
must create a text file called c:\thelistfile.txt
and add a few lines to it--->
<AMFILEREAD FILE="c:\thelistfile.txt" RESULTVARIABLE="filecontents">
<AMLOOPLIST LIST="%filecontents%" RESULTVARIABLE="currentitem" DELIMITER="new_line">