Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Reuse One Menu Across a Multi-Screen Flow

Define a menu once with the New Navigation Item Collection action, show it on every screen, and route the agent to the screen they pick with a Decision.

Some flows outgrow one screen. A service agent working an account moves between an overview, a contacts screen, an opportunities screen and a cases screen, each with its own components and its own validation. A side menu on every screen lets the agent jump to any of them in one click, in any order. You define the menu once, and a Decision sends the agent where they clicked.

A side menu with Overview active next to the account overview
The same side menu sits on every screen of the flow.

Before you start

  • A screen flow that receives the account Id, for example a text input variable recordId.

  • The New Navigation Item Collection action page, for the fields each item accepts, and the Navigation reference for the component settings.

  • If the four views fit on one screen, tabs on one screen are simpler. Use this pattern when each view needs its own screen.

How the flow is shaped

The flow runs in a loop: build the menu once, then a Decision picks the screen, the agent clicks a menu item, an Assignment stores the item, and the flow goes back to the Decision. In the figure, a Get Records on the account also runs before the Decision, for the fields the screens display.

Flow canvas with Build Menu, Get Account, a Route decision, four screens and assignments looping back to Route
Build the menu once, route, store the click, loop back.

Steps

1

Build the menu once with the action

  1. At the start of the flow, add an Action element and pick New Navigation Item Collection (category Avonni). Name it Build_Menu.

  2. Under Navigation Items, add four items with these Label and Value pairs: Overview overview, Contacts contacts, Opportunities opportunities, Cases cases.

Flow Builder stores the action's output, a collection of navigation items, under the action's name. Every screen will read the same Build_Menu output, so a new item added here appears on all screens at once.

2

Create the variable that remembers the current item

Create a Text variable named activeItem with the default value overview. It holds the item the agent picked last, and it decides which screen comes next.

3

Add the router Decision

Add a Decision element after the action, named Route. Create one outcome per item, in menu order:

  • Outcome Overview: {!activeItem} Equals overview

  • Outcome Contacts: {!activeItem} Equals contacts

  • and so on for opportunities and cases.

Point the default outcome to the Overview screen too, so an unexpected value never strands the agent.

4

Add the Navigation to each screen

On each outcome, add a Screen element with an Avonni Navigation on it, then your own components for that view. In the Component Builder of each Navigation:

  1. Set Orientation to Vertical for a side menu.

  2. Choose the Variable data source. Under Items Collection, choose Custom and type Build_Menu, the action's API name (the dropdown does not list action outputs).

  3. Set Active Navigation Item Value to {!activeItem}, so the menu highlights the screen the agent is on.

5

Leave the screen when an item is clicked

On each Navigation, open the Interactions tab and add a Select interaction:

  1. Leave Target Name empty. An empty target fires for every item, which is what a menu needs.

  2. Set Type to Flow Navigation. A second Type field appears: set it to Next Screen.

The Navigation sets Active Navigation Item Value to the clicked item before it moves the flow on, so the value is ready on the next element. See Flow Navigation for the other navigation types.

Select interaction set to Flow Navigation, Next Screen, with no target name
An empty Target Name makes every menu item move the flow on.
6

Store the clicked item and loop back

After each screen, add an Assignment: {!activeItem} Equals that screen's Navigation > Active Navigation Item Value (for example {!ContactsMenu.activeNavigationItemValue}). Connect the Assignment back to the Route Decision.

Each screen needs its own Assignment, because each Navigation has its own API name. Connect back to the Decision, not to the action: the menu is already built.

7

Save and test

Save and click Debug. The flow opens on Overview with Overview highlighted in the side menu. Click Cases: the flow moves to the Cases screen and the menu now highlights Cases. Click Contacts, then Overview: each click lands on the matching screen, in any order.

To stop agents using the standard Next and Previous buttons, which would leave the loop, hide them in each screen's footer settings. The menu is then the only way to move.

Troubleshooting

A click reloads the same screen

The Assignment after that screen reads another screen's Navigation. Check that {!activeItem} is assigned from the Navigation on the screen the Assignment follows.

The menu highlights the wrong item on a screen visited before

Flow can reuse the values from the agent's last visit to a screen. Select the Navigation on the screen and, in the Flow Builder properties pane (not the Component Builder), open its Advanced section and set Revisited Screen Values to refresh inputs, so Active Navigation Item Value reads {!activeItem} again.

Nothing happens on click

The Select interaction is missing, or its Target Name holds one item's value, so only that item fires. Clear Target Name.

Was this helpful?