Building a Navigation Menu with Related Records
Turn an account's open opportunities into a side menu and show the details of the one the agent clicks next to it, on the same flow screen.
A service agent reviewing an account wants to scan its open opportunities and read one in detail without opening each record. A side menu that lists the opportunities by name, with their stage under each name, does that in one screen. When the agent clicks one, its details appear next to the menu.

Before you start
A screen flow that receives the account Id, for example a text input variable
recordId.The Navigation reference, for the other Data Mappings fields.
Steps
Get the account's opportunities
Add a Get Records element before the screen:
Object: Opportunity
Filter:
AccountIdEquals{!recordId}, andIsClosedEqualsFalsefor open opportunities onlySort:
CloseDate, ascendingHow Many Records to Store: All records
Name it Get_Opportunities. Its record collection is the menu's data.
Point the Navigation at the collection
Add a Screen element and drag an Avonni Navigation onto it. Name it
OppMenu.In the Component Builder, set Orientation to Vertical.
Choose the Variable data source and select Get Opportunities under Items Collection.
Each record in the collection becomes one menu item.
Map the fields of each item
In Data Mappings, tell the Navigation which field fills each part of an item:
Label
Name
The opportunity name
Value
Id (the default)
Nothing: it identifies the item
Description
Stage
The stage, under the name
Keep Value on the record Id. It is unique, which a name is not, and it is what the Navigation returns when the agent clicks. Description only shows in a vertical menu.

Show the selected opportunity
Below the Navigation, add a Section, and inside it a Display Text.
In the Display Text, insert fields from
OppMenu> Active Navigation Item SObject: for example{!OppMenu.activeNavigationItemSObjectValue.Amount}and{!OppMenu.activeNavigationItemSObjectValue.CloseDate}.On the section, open Set Component Visibility:
OppMenu> Active Navigation Item Value Is NullFalse.
Active Navigation Item SObject is the whole record behind the clicked item, so any field queried by Get_Opportunities is available without a second Get Records. The visibility rule hides the empty section until the agent picks an opportunity.
To act on the clicked record after the screen, for example in an Update Records element, read the same Active Navigation Item SObject output. To open a screen per opportunity instead, add a Select interaction as in Reuse one menu across a multi-screen flow.
Troubleshooting
Related tutorials
Build tabs on one screen with Navigation: fixed tabs instead of records, with the same visibility technique.
Add sub-menus and columns to a navigation menu: nest items under a parent item.
Build a navigation menu from a picklist: items from a field's values rather than from records.
Last updated
Was this helpful?
