A new Iterate List action introduced in version 22.214.171.124 allows for iterating a collection of items and calling a designated Action List once for each item in the collection.
The action will iterate any IList<object> collection. The collections to iterate can come from the results of other Actions, such as the Find Files and the Find Services actions. The Set Shared Property action has been extended to include a new Text List type of Shared Property, which can be iterated. And finally, the Iterate List action can be used in conjunction with the C#/VB.Net action, which exposes programmatic access to the entire Shared Properties dictionary, to perform complex repetitive operations during package execution.
To demonstrate the usage of this action, we’ll add 10 sub-directories to our Application Install Directory and add an image file to each one. We’ll start by creating the Action List that will add the files to the designated directory. Note the use of the item Shared Property.
Next, we’ll create the List to iterate. This list will contain the Directory Names for each of the new directories. The Action List will use the current value of the list item to define the directory name. The value is provided to the Action List in the form of a Shared Property (item), who’s key value is defined by the Iterate List action settings.
Finally, we’ll add the Iterate List action to the Primary Action List. Configure it to iterate our list created by the Set Shared Property action and call our specific CreateAndPopulate Action List once for each item.
While the example provided is quite trivial, the demonstrated usage of the Iterate List action will hopefully trigger thoughts on how the action can improve the installation and maintenance of your AppLife managed applications.