ForEach<T> Activity Designer


The ForEach<T> activity executes the activity contained in its Body for each item in a specified Values collection.

The following table shows the most useful ForEach<T> activity properties and describes how to use them in the designer.

Property NameRequiredUsage
DisplayNameFalseThe friendly name of the ForEach<T> activity. The default is ForEach<Int32>. Although the DisplayName value is not strictly required, it is a best practice to use one.
ValuesTrueThe collection of items to iterate over. To set the Values, type a Visual Basic expression in the Values box on the ForEach<T> activity designer or in the property grid.
TypeArgumentTrueThe type of the items in the Values collection specified by the generic parameter T. By default, TypeArgument is set to Int32. To change the type, change the value of the TypeArgument combo box in the property grid.

By default, the loop iterator is named item. You can change the name of the iterator variable in the ForEach<T> activity designer. The loop iterator can be used in expressions in the children of the ForEach<T> activity.

Control Flow