Branch ForEach Step: Avoid Unexpected Validation WarningsLast Updated: 11/21/2018 Introduced in Version:
When using a Branch For Each Step, a common error can be avoided which occurs only when Forms are added into the flow following the Branch ForEach Step. If you run into a validation warning for this reason, a message will read “A linked Flow Step must Follow the Branch For Each”. What this means is that any Form following a Branch For Each Step must not be in the flow. The Forms either need to be encapsulated into a linked flow or a sub-flow and then called by the Flow using the Branch For Each.
Example: Encapsulating Forms into a Linked Flow
Start by creating a Flow for any Form or Forms that are being used in a flow following the Branch ForEach Step. This Flow can be added into the main flow using a subflow.
The Form is assigned to all employees requesting each employee to agree for “Travel to be booked for a ski trip”. Each employee must agree before the flow can merge and continue.
- Start Step: Favorites> Show Form
- Sign Waiver Form: Favorites> Show Form
Create a subflow for one or more Forms (Figure 1)
Configure the Steps
On the Start Step define the Flow Input Data by adding a data name called emailaddress and choose the Type as Account (Figure 2).
On the Sign Waiver Form, this example shows a simple Form is used with a submit button (Figure 3)
Next, connect the pathways and save and exit the flow. After a flow has been created and the Branch ForEach Step has been added, add a subflow with any Forms that need to be used in the Flow.
GetAll: Integrations > Internal Services > Account Service> Get All.
BranchForEach: All Steps [Catalog] > Flow Management
Subflow1: Flows, Rules, Forms, and Reports > [Current Folder]
Merge Step: All Steps [Catalog]> Flow Management
Encapsulating Forms into a Linked Flow: “A linked Flow Step must follow the Branch ForEach Step” (Figure 2)
Add a Linked Flow/ Subflow
Now use the Linked Flow/ Subflow created containing the Forms that are needed for the flow and save. In the designer Folder, locate the Main Flow and then, on the For Each outcome path from the Branch For Each step add the Linked Flow from the Flows, Rules, Forms, and Reports > [Current Folder] category.
Connect the Done outcome from the Linked Flow to the Merge Step. Select Linked Flow Step Select Value of Item outcome from the Branch Step as Account Input to this step. In the Inputs section choose Select From Flow and choose Item. This Item contains the Accounts and email address that are being called.
This completes the Flow example describing how to fix unexpected errors on a Branch ForEach step.