Step Type: Iterate
The Iterate step executes another procedure multiple times, looping over a list of values. Each iteration passes the current value to the target procedure as a special loop_value variable.
When to Use
- To run the same migration procedure for each item in a list (e.g., each table, each department, each batch of records)
- To process extracted records one at a time or in groups
- To execute parameterized migrations across multiple configurations
Configuration
| Setting | Description |
|---|---|
| Target Procedure | The procedure to execute on each iteration |
| Loop Variable | A list-type variable to iterate over |
| Input Variables | Override the target procedure’s defaults (can reference loop_value) |
| Output Variable | Variable to collect results from all iterations (optional) |
How It Works
- The step reads the loop variable, which must contain a list of values
- For each value in the list:
- The current value is set as the
loop_valuevariable - Input variable overrides are evaluated (and can referenceloop_value) - The target procedure is executed with the configured inputs - The iteration result is collected - After all iterations complete, collected results are stored in the output variable
- Progress is tracked with iteration count
The loop_value Variable
During each iteration, the special loop_value variable contains the current item from the loop list. You can reference it in input variable overrides:
Loop variable: ["INC0010001", "INC0010002", "INC0010003"]
Input variable override:
IncidentNumber = loop_value
On iteration 1, loop_value is "INC0010001", on iteration 2 it’s "INC0010002", and so on.
Example
To migrate incidents one at a time from a list:
- Use an Extract Records or Assign Variables step to create a list of incident numbers
- Add an Iterate step:
- Loop variable: the list of incident numbers
- Target procedure: “Migrate Single Incident”
- Input variables:
IncidentNumber = loop_value - The “Migrate Single Incident” procedure runs once for each incident number in the list
Comments
0 comments
Please sign in to leave a comment.