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 you’ve learned about a good tool to use when a flow is important enough to be expanded automatically: a Lightning page. And you’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, you can create a different flow action for each object, make sure it references the same flow, and add it to the various page layouts. That approach would be a lot of work up front, and it 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 appear only 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 they’re on in the app. 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.
- Open the Sales Lightning app.
- In Setup, in the Quick Find box, enter
App
and then select App Manager.
- For the app whose Developer Name is LightningSales, click and select Edit.
- In Setup, in the Quick Find box, enter
- Add the flow to the Sales Lightning app’s utility bar.
- Under App Settings, click Utility Items (Desktop Only).
- Click Add Utility Item and select Flow.
- In the utility item properties, change the label to
Utility Bar Flow
, then replace the default icon with the flow icon ().
- For Panel Height, enter
200
.
- In the component properties, for Flow, select Hello World.
You can also set your flow’s input variables in the utility bar, similar to how they’re configured on Lightning apps and home pages. However, utility bars don’t know which record your user is currently viewing, so you can’t pass the current record’s ID or any of its values into the flow.
- Under App Settings, click Utility Items (Desktop Only).
- Save your changes and 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.
- From the App Launcher (), find and select Sales.
Notice the bar running along the bottom of the page. That’s our utility bar. If you don’t see it, refresh the page.
- 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.
- Open a contact record.
- Click 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 you’re viewing that page in the associated app. OK, enough about when the utility bar appears. Let’s see how the flow works in the utility bar.
- Click and return to the Sales app.
- In the utility bar, click Utility Bar Flow.
Notice that the utility item’s label is Utility Bar Flow, but the key header is Hello World (the flow’s name). As a bonus, if a user is part way through a flow when they need to switch gears, they can minimize the flow. Even if they move to another page in the app, the flow keeps running without interruption.