Spotfire® Automation Services User Guide

ForEach

You can use this task to allow jobs to loop over a list of items and execute other tasks once for each row.

The table chosen for iteration can either be embedded in the task or be referenced as a CSV file on a file share.
Note: The file must be accessible by the user account that starts the Automation Services service.

Loop tasks cannot be nested inside each other, which means no ForEach inside another ForEach, but a job can have more than one loop, as long as they are not nested. The task will include the statement ForEach End to show the end of the iteration.

If a task fails within a loop, you can select if the job should continue with the next iteration, or if the whole job should end. In the Automation Services Job Builder, a warning will be shown if the table or the external file is incorrect.

To insert data from the table into text fields inside of the ForEach loop, go to Tools > Insert field. See Inserting a field in a Spotfire Automation Services job to learn more about how to use Insert field.