Display a Flow on Every Page in Your Salesforce Org

Learning Objectives

After completing this unit, you’ll be able to:
  • Describe use cases for displaying a flow on every page in your app.
  • Create a Lightning app and add a flow to its utility bar.

So far we've learned about a good tool to use when a flow is important enough to be expanded automatically: a Lightning page. And we've also learned about a good tool to use when a flow should be accessible from a record but not expanded automatically: a flow action.

But what about flows that should be accessible from records of more than one object? Technically, we can create a different flow action for every object, make sure it references the same flow, and add it to the various page layouts. Besides the fact that it would be a lot of work up front, that approach sounds like a maintenance nightmare.

The Lightning utility bar is much better suited to making a single flow available on several pages in an app. It appears as a fixed footer that users can access to open utilities in docked panels. Each utility bar is tied to a specific Lightning app, so its items only appear when the user is in that app.

Add a flow component to your app's utility bar, and with a click of a button, it's available to users no matter which page in the app they're on. Of course, this means you should be triply sure of how frequently users need to run your flow.

Add Your Flow to a Utility Bar

Adding a flow to a utility bar is very similar to adding a flow to a Lightning page.

  1. Open the Sales Lightning app.
    1. In Setup, enter App in the Quick Find box, then select App Manager.
    2. For the app whose Developer Name is LightningSales, click the down arrow and select Edit.
  2. Add the flow to the Sales Lightning app’s utility bar.
    1. Under App Settings, click Utility Items (Desktop Only).
    2. Click Add Utility Item, and select Flow.
    3. In the utility item properties, change the label to Utility Bar Flow. Replace the default icon with the flow icon.
    4. In the component properties, for Flow select Sample Flow. The properties pane for a Flow component, where Flow is Sample Flow. Input variables in the utility bar work exactly the same as they do on Lightning apps and home pages. If your flow has any input variables, you can set their values here.

  3. Save your changes, then click Back.
    Adding a newly created component to the Utility Bar can take several minutes to propagate to every page in the org.

Test Your Flow

Finally, let's take a tour of the utility bar, then test the flow we added to it.

  1. From the App Launcher ( App Launcher Icon), find and select Sales. Notice the bar running along the bottom of the page. That's our utility bar. The utility bar on the home page includes Utility Bar Flow.
  2. Click around to different pages in the app. Open a contact record. Go to Leads Home. Notice that, no matter which page you're on in the Sales app, the flow is available. The utility bar on the contact record for Ms. Rose Gonzalez also includes Utility Bar Flow.
  3. Click App Launcher icon and open the Service app. Notice that Utility Bar Flow doesn't appear at the bottom of the page. That's because a utility bar is always tied to a specific Lightning app. Once you add a utility bar, it's available on any page, as long as that page is in the associated app.
  4. OK, enough about when the utility bar appears. Let's see how the flow works in the utility bar.
    1. Click App Launcher icon and return to the Sales app.
    2. In the utility bar, click Utility Bar Flow. The utility bar on the home page with Utility Bar Flow open.

Notice that we still see the utility item's label (Utility Bar Flow), but the key header is the flow's name (Sample Flow). As a bonus, if a user is partway through a flow when they need to switch gears, they can minimize the flow. Even if they move to another page in the app, their progress in the flow is saved.

Resources