Adding iteration to a flow
You can use the Split For Each shape to create a loop in a flow that iterates over a group or list of pages. By using iteration, you can apply the same logic to information that varies in size from case to case.
-
Ensure that the loop limits for your production level can support your flow.
-
Open the MaxFlowLoopCount application setting by searching for it or by using the Records Explorer.
-
On the Settings tab, review the limit value for the production level of your system.
-
If the number of pages that you plan to process in your flow exceeds the limit value, increase the number in the Value column.
Loop limits are enforced by your application to prevent flows from entering infinite loops.
-
-
Add the Split for Each shape to your flow.
- Open a flow by searching for it or by using the Application Explorer.
-
On the Diagram tab, click the Flow shapes icon, and then click Advanced > Split For Each.
-
Drag the Split for Each shape to a position on the flow diagram, based on the order of events in the flow.
-
Connect the Split for Each shape, by dragging connector end points to connection points on different shapes in the flow.
-
Define how the flow iterates over information in a case.
-
Double-click the Split for Each shape to open the property panel.
Some of the following options are not available for screen flows.
-
In the Join list, select Iterate.
-
In the Page property field, press the Down Arrow key and select a property that stores a group or list of pages.
CAUTION:Do not change the structure or indexing of the pages in this property, because it can lead to unexpected results. -
In the Class field, enter the class name that your application uses to find the page property, the flow tt runs for each page in the page property, and any conditions that you define.
-
In the Flow name field, press the Down Arrow key and select a flow that runs on each page in the page property.
- To control whether the flow runs for all or some pages in the page property, press the Down Arrow key in the When field, and then select a when condition that evaluates values in each page.
-
To control whether the Split For Each shape evaluates all or some pages in the page property, press the Down Arrow key in the
Exit iteration when
field, and then select a when condition in the same class path as the parent flow.
For example, you can stop processing a list of votes after you reach the number of yes votes that constitutes a majority.
-
-
Control the order in which your flow processes pages in a group.
-
In the Page group iteration settings section, click + Add condition.
-
In the Subscript order field, enter text that your flow compares with the subscript value for each page in the group.
By default, your flow determines whether the subscript value contains the text that you provide.
- To ignore the pages in the group that do not match the
subscript order that you provide, clear the Process remaining
changes check box.
Otherwise, your flow evaluates these pages after it processes all conditions in the Page group iteration settings section.
-
-
Click Submit to close the property panel.
-
Click Save .