Display Flow Stages with a Progress Indicator on the Flow Screen
If you track stages in your flow, display them at runtime by adding a custom component to the flow’s screens. Create a progress indicator component that displays the flow’s active stages and current stage, and make sure that it’s available for flow screens. When you add the component to each flow screen, pass the $Flow.ActiveStages and $Flow.CurrentStage global variables into the component’s attributes.
-
Create the custom
flowStagescomponent.The
flowStagescomponent useslightning:progressindicatorto display the flow’s stages. -
Create the design resource for the
flowStagescomponent.The design resource includes the
stagesandcurrentStageattributes so that they’re available in Flow Builder. -
Create the CSS style resource for the
flowStagescomponent. -
Create the client-side controller for the
flowStagescomponent.For each item in the
stagesattribute, theinitmethod adds alightning:progressStepcomponent to theflowStagescomponent markup. -
Create a flow in Flow Builder.
-
From Setup, in the Quick Find box, enter
Flows, and then select Flows. Then click New Flow. -
Select Start From Scratch, and then click Next.
-
Select Screen Flow as the flow type, and then click Create.
-
-
Configure the stages in your flow.
-
Click the Manager panel icon
, and then click New Resource. Then select Stage. -
Enter a label and order, and then specify whether the stage is active by default.
If you select Active by default, the stage is added to
{!$Flow.ActiveStages}when a flow interview starts.
-
-
Configure the screen elements in your flow.
-
Click the Add Element icon
on the canvas. -
Select the Screen interaction element.
-
To the screen, add the custom flowStages component. For Current Stage, enter
{!$Flow.CurrentStage}. For Stages, enter{!$Flow.ActiveStages}. In the Advanced section, select Manually Assign Variables.
-
-
Configure the assignment elements in your flow.
-
Between each screen element, click the Add Element icon
on the canvas. -
Select the Assignment logic element.
-
Set the
Current Stagevariable equal to the following stage in the flow.For example, for the assignment element between the screens that contain the first and second stages, set the
Current Stageequal to name_of_second_stage.
-
-
Save your flow.

See Also