Display a Flow on Every Page in Your Salesforce Org
- 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.
- Open the Sales Lightning app.
- In Setup, enter App in the Quick Find box, then select App Manager.
- For the app whose Developer Name is LightningSales, click the down arrow and select Edit.
- 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. Replace the default icon with the flow icon.
- In the component properties, for Flow select 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.
- 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.
- 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 the bar, 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.
- 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 that page is 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 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.
- Salesforce Help: Add a Utility Bar to Lightning Apps