Assign List (Array)
What does Assign List do?
When you need to set a list of values (ie. an array) to be used later, such as with a “for each” (iteration) loop, you should use the Assign List directive to create an array.
Note: For more information about arrays, read about using arrays.
How do I use the Assign List directive?
Once you have added this directive to your Prog command, enter each separate item on its own line:
You will see an output variable, which you can reference:
Note: The output variable uses the suffix of [step prefix].data
.
During the execution of your Prog command, the Proggy CLI tool will convert this list into a Liquid template array. Typically, however, this directive is used in conjunction with a For Each Loop.
Behaviour of the Assign Key/Value Pair directive
- Array lists values are not parsed by Liquid before becoming available. This means that the values you enter into there are hardcoded. If you need to dynamically change the values at runtime, have a look at Runtime Variables to see how you can achieve this behaviour.
Example use cases for the Assign Key/Value Pair directive
- For use with For Each Loops