Description
Exits a For Each loop activity.
Attributes
Common
- Continue on Error - True or False values to specify whether to continue executing the next activity even if an error is thrown on the current activity.
Misc
Display Name - Renames the activity.
Example
- Create a new workflow and save it as NewContinueWorkflow.xml.
- Add a For Each<> activity inside the Sequence.
- Inside the Sequence, create a variable named x of the type IEnumerable<Int32> and give it the default value {1,2,3,4,5}.
- In the Values Input Field of the ForEach<> activity, enter x.
- Add an If activity inside the ForEach<> activity.
- In the Condition Input Field of the If activity, enter item <= 4.
- Add a Write Line activity inside the Then field of the If activity and enter item.toString in its Text Input Field.
- In the Else field, drag and drop the Continue activity. This will enable us to exit from the ForEach<> activity.
- When executed, the Sequence activity executes the ForEach<> activity inside it until the condition is met and we exit from the loop.
The use case should look like the following screenshot:
The output should look like this in the Output panel: