Last Updated on February 5, 2025 by Rakesh Gupta
Big Idea or Enduring Question:
-
How can I display a progress path in a Screen Flow to indicate the progress of a form?
Objectives:
After reading this blog, you’ll be able to:
- Create a Lightning Web Component to show a progress path in Screen Flow
- Add and configure a custom Lightning Web Component in Screen Flow
- And much more
Business Use case
Warren Mason, is working as a Junior Developer at Gurukul on Cloud (GoC), received feedback from the Marketing leadership team while working on a lead referral form. The suggestion was to include a progress path with stages, making it clear for users to understand how much of the form they have completed and how much is left.
The progress path should be similar to the example shown in the demo below:
This feature aims to enhance user experience by providing a visual representation of their progress through the form.
What Is a Progress Path?
A progress path is a visual representation used in forms, applications, and workflows to indicate the current stage of completion and guide users through the steps or stages involved in a process. It typically appears as a series of steps or markers that highlight the user’s journey from the beginning to the end of a multi-step process.
Benefits of Using a Progress Path
- Enhanced User Experience: Helps users navigate complex forms or processes with ease.
- Clarity and Transparency: Users can see their progress at a glance, which can motivate them to complete the process.
- Reduced Drop-off Rates: By making the process clear and straightforward, users are less likely to abandon it midway.
Progress paths are commonly used in multi-step forms, onboarding processes, e-commerce checkout flows, and project management tools to provide a better, more intuitive user experience.
Automation Champion Approach (I-do):
There are a few possible solutions for the above business scenario. We will use Lightning Web Component and Screen Flow to solve the requirement.
Guided Practice (We-do):
There are 2 steps to solve Warren’s business requirement using Lightning Web Component and Screen Flow. We must:
- Create a Progress Path custom component using lightning web component
- Salesforce Flow StepsÂ
- Define flow properties for screen flow
- Create a text variable to store the stages in a comma-separated format
- Add a screen element to display the progress path custom componentÂ
Step 1: Create a Progress Path Component Using the Lightning Web Component
First, create a Progress Path Lightning Web Component that can be used with Screen Flow using the code below. If you don’t know how to create a Lightning Web Component, please review this developer guide Create a Lightning Web Component.
screenFlowProgressPath.html
<template>
<lightning-progress-indicator current-step={currentStepValue} type="path" variant="base">
<template for:each={steps} for:item="step">
<lightning-progress-step label={step.label} value={step.value} key={step.value}></lightning-progress-step>
</template>
</lightning-progress-indicator>
</template>
screenFlowProgressPath.js
import { LightningElement, api, track } from 'lwc';
export default class DynamicProgressPath extends LightningElement {
@api currentStep;
@api stepsString;
@track steps = [];
@track currentStepValue;
connectedCallback() {
this.initializeSteps();
this.setCurrentStepValue();
}
initializeSteps() {
this.steps = this.parseSteps(this.stepsString);
}
parseSteps(stepsString) {
return stepsString.split(',').map((step, index) => ({
label: step.trim(),
value: `step-${index + 1}`
}));
}
setCurrentStepValue() {
this.currentStepValue = this.getStepValue(this.currentStep);
}
getStepValue(currentStepLabel) {
const step = this.steps.find(step => step.label === currentStepLabel);
return step ? step.value : '';
}
}
screenFlowProgressPath.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<isExposed>true</isExposed>
<masterLabel>LWC Progress Path</masterLabel>
<description>LWC Progress Path</description>
<targets>
<target>lightning__FlowScreen</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__FlowScreen">
<property name="currentStep" type="String" label="Current Step" />
<property name="stepsString" type="String" label="Comma-separated Steps" />
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
Copy code from GitHub or Install using this URL.Â
Step 2.1: Define Flow Properties
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows then click on the New Flow.
- Select the Start From Scratch option and click on Next.

- Select the Screen Flow option and click on Create and configure the flow.

Step 2.2: Create a Text Variable to Store the Stages in a Comma-separated Format
The next step is to create a text variable to store the stages in comma-separated values. For this example, we have five stages as mentioned below:
- Referrer Info
- Lead Info
- Financial Info
- Additional Info
- Submit Confirmation
- Under Toolbox, select Manager, then click New Resource to store the stages.
- Input the following information:Â
- Resource Type: Variable
- API Name: varT_Stages
- Data Type:Â Text
- Default Value: Referrer Info,Lead Info,Financial Info,Additional Info,Submit Confirmation
- Check Available for Input
- Check Available for Output
- Click Done.

Step 2.3: Add a Screen Element to Display the Progress Path Lightning Web Component
- On Flow Designer, click on the +icon and select the Screen element.
- Input the following information:
- Under the Input section on Screen Element, drag and drop the LWC Progress Path component onto the screen.
- Input the following information:
- Api Name: Path1
- Comma-separated Steps: {!varT_Stages}
- Current Step: Referrer Info
- Note: Referrer Info is our first stage. For more information, please refer to step 2.2, which outlines all five stages.
- Click Done.

For the remaining four screens, follow the same steps, except for changing the Current Step as shown below.
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.





