How to Visualize Progress in Salesforce Screen Flows

How to Visualize Progress in Salesforce Screen Flows: A Step-by-Step Guide

Salesforce Screen Flows are powerful tools for guiding users through complex processes, but without clear progress indicators, users can feel lost or frustrated. Visualizing progress not only improves the user experience but also increases completion rates and overall satisfaction. This guide will walk you through various methods to effectively display progress in your Salesforce screen flows, from simple text indicators to more sophisticated progress bars.

Why Visualize Progress in Screen Flows?

Before diving into the “how,” let’s briefly touch upon the “why”:

1. User Experience:

Users know where they are in a multi-step process, reducing anxiety and increasing confidence.

2. Reduced User Error:

Clear progress cues help users anticipate the next steps and avoid missteps.

3. Improved Completion Rates:

When users see the end in sight, they are more likely to complete the flow.

4. Professional Appearance:

Flows with clear progress indicators appear more polished and professional.

5. Better Adoption:

Users are more likely to embrace flows that are intuitive and easy to navigate.

Methods for Visualizing Progress

There are several ways to visualize progress in Screen Flows, ranging from basic to advanced. We’ll cover the most common and effective methods.

Method 1: Simple Text Indicators (Current Step / Total Steps)

This is the most straightforward method and ideal for flows with a small number of steps.

Step-by-Step Implementation:

1. Create a Text Display Component on Each Screen:

On each screen of your flow, drag a “Display Text” component onto the canvas.

In the “Text” field, enter something like “Step {!$Flow.CurrentScreenNumber} of {!$Flow.TotalScreens}.

2. Adjust TotalScreens (Important Note):

Example:

A flow with three screens would display

Method 2: Highlighting Current Screen (Navigation Links)

This method involves creating navigation links at the top of your screens, similar to breadcrumbs, and highlighting the current screen.

Step-by-Step Implementation:

1. Create a Text Display Component for Navigation:

2. Use Conditional Formatting for Highlighting:

For each step, you’ll use a formula to determine if it’s the current step.

Example (for a 3-step flow):

<!– end list –>

HTML

<p> <span style=”{!IF($Flow.CurrentScreenNumber == 1, ‘font-weight: bold; color: blue;’, ”)}”>Step 1: Contact Info</span> &nbsp;&nbsp;&gt;&nbsp;&nbsp; <span style=”{!IF($Flow.CurrentScreenNumber == 2, ‘font-weight: bold; color: blue;’, ”)}”>Step 2: Opportunity Details</span> &nbsp;&nbsp;&gt;&nbsp;&nbsp; <span style=”{!IF($Flow.CurrentScreenNumber == 3, ‘font-weight: bold; color: blue;’, ”)}”>Step 3: Confirmation</span> </p>

3. Consider Flow Navigation Actions (Advanced):

Method 3: Progress Bar (Using Formulas and Images/Components)

This method provides a more visual and intuitive representation of progress. This can be achieved using a combination of formulas and either static images or custom components.

Option A: Basic Progress Bar using Text/Emojis

This is a simplified progress bar using text characters or emojis.

Step-by-Step Implementation:

1. Create a Formula Variable (Text) for the Progress Bar:

Go to “Manager” on the left panel, click “New Resource,” and select “Formula.”

Resource Type: Formula

Data Type: Text

API Name: Progress_Bar (or similar)

Formula:

<!– end list –>

CASE(
    $Flow.CurrentScreenNumber,
    1, "⚪⚪⚪", /* Or "☐☐☐" or "●○○" */
    2, "🔵⚪⚪", /* Or "☑☐☐" or "●●○" */
    3, "🔵🔵⚪", /* Or "☒☐☐" or "●●●" */
    4, "🔵🔵🔵", /* Or "☑☑☐" or "●●●●" */
    "No Progress" /* Default value if number is out of range */
)

Explanation:

2. Display the Progress Bar on Each Screen:

Option B: Progress Bar Using Image Resources (More Visual)

This method uses different static image files (uploaded as static resources) to represent each stage of progress.

Step-by-Step Implementation:

1. Create Progress Bar Images:

Design a series of images (e.g., PNG, SVG) representing each progress stage.

2. Upload Images as Static Resources:

3. Create a Formula Variable (Text) for the Image URL:

Go to “Manager” on the left panel, click “New Resource,” and select “Formula.”

Resource Type: Formula

Data Type: Text

API Name: Progress_Image_URL (or similar)

Formula:

<!– end list –>

CASE( $Flow.CurrentScreenNumber, 1, “/resource/ProgressBarStep1”, /* Assuming ProgressBarStep1 is your Static Resource API Name */ 2, “/resource/ProgressBarStep2”, 3, “/resource/ProgressBarStep3”, “” /* Default if no match */ )

4. Display the Image on Each Screen:

On each screen, drag a “Display Text” component.

In the “Text” field, use an HTML <img> tag:

<!– end list –>

HTML

<img src=”{!Progress_Image_URL}” alt=”Progress Bar” style=”width: 100%; height: auto;”>

Option C: Progress Bar Using a Custom Lightning Web Component (LWC)

This is the most flexible and visually appealing option but requires LWC development skills.

Step-by-Step Implementation:

1. Develop an LWC for the progress bar:

Create an LWC that takes a currentStep and totalSteps property.

The LWC’s HTML and CSS will render the progress bar visually (e.g., using div elements with dynamic widths, SVG, or styling with SLDS utility classes).

Example progressIndicator.js:

import { LightningElement, api } from ‘lwc’;

export default class ProgressIndicator extends LightningElement {
@api currentStep;
@api totalSteps;

get progressWidth() {
    if (this.totalSteps === 0) return '0%';
    const width = (this.currentStep / this.totalSteps) * 100;
    return `${width}%`;
}

get stepsArray() {
    return Array.from({ length: this.totalSteps }, (_, i) => i + 1);
}

}

Example progressIndicator.html:

<template>
    <div class="progress-container">
        <div class="progress-bar" style="width: {progressWidth};"></div>
    </div>
    <div class="slds-grid slds-grid_align-spread slds-m-top_x-small">
        <template for:each={stepsArray} for:item="step">
            <div key={step} class="slds-text-heading_small slds-p-horizontal_x-small"
                 title="Step {step}"
                 class:current-step={_isCurrentStep}>
                 {step}
            </div>
        </template>
    </div>
</template>

Example progressIndicator.css:

.progress-container {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
    height: 10px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background-color: #0070d2; /* Salesforce blue */

Example progressIndicator.js-meta.xml:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>58.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__FlowScreen</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__FlowScreen">
            <property name="currentStep" type="Integer" label="Current Step Number" description="The current step in the flow." />
            <property name="totalSteps" type="Integer" label="Total Steps" description="The total number of steps in the flow." />
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

2. Deploy the LWC to Salesforce:

3. Add the LWC to Your Flow Screens:

In your Screen Flow, drag the custom LWC component (it will appear under the “Custom” section) onto each screen.

Set Input Values:

Handling Conditional Screens and Dynamic Progress

The $Flow. TotalScreens and $Flow. CurrentScreenNumber variables are great for linear flows. However, if your flow has conditional paths where some screens are skipped, these variables might not accurately reflect the user’s perceived progress.

Strategies for Dynamic Progress:

1. Custom “Total Steps” Variable:

2. Custom “Current Step” Variable:

3. Formula-Based Dynamic Step Calculation:

4. Using a Subflow for Progress:

Best Practices for Progress Visualization

Conclusion: Salesforce Screen Flows

Visualizing progress in Salesforce Screen Flows is a small effort that yields significant benefits in user experience and flow completion rates. Whether you opt for simple text indicators, more engaging progress bars using images or custom components, or dynamic progress based on flow logic, the key is to provide clear and consistent feedback to your users. By implementing these strategies, you can transform your Salesforce screen flows from functional tools into intuitive and delightful user journeys.

Contact Us
Loading
Your message has been sent. Thank you!
© Copyright iTechCloud Solution 2024. All Rights Reserved.