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

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.

A vertical menu of open opportunities with stages and the selected one's details below
Each open opportunity is a menu item, its details show on click.

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

1

Get the account's opportunities

Add a Get Records element before the screen:

  • Object: Opportunity

  • Filter: AccountId Equals {!recordId}, and IsClosed Equals False for open opportunities only

  • Sort: CloseDate, ascending

  • How Many Records to Store: All records

Name it Get_Opportunities. Its record collection is the menu's data.

2

Point the Navigation at the collection

  1. Add a Screen element and drag an Avonni Navigation onto it. Name it OppMenu.

  2. In the Component Builder, set Orientation to Vertical.

  3. Choose the Variable data source and select Get Opportunities under Items Collection.

Each record in the collection becomes one menu item.

3

Map the fields of each item

In Data Mappings, tell the Navigation which field fills each part of an item:

Mapping
Field
What the agent sees

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.

Data Mappings mapping Name to Label, Id to Value and StageName to Description
Name, Id and stage fill each item.
4

Show the selected opportunity

  1. Below the Navigation, add a Section, and inside it a Display Text.

  2. In the Display Text, insert fields from OppMenu > Active Navigation Item SObject: for example {!OppMenu.activeNavigationItemSObjectValue.Amount} and {!OppMenu.activeNavigationItemSObjectValue.CloseDate}.

  3. On the section, open Set Component Visibility: OppMenu > Active Navigation Item Value Is Null False.

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.

5

Save and test

Save and click Debug with an account that has open opportunities. The menu lists them by name, each with its stage below. No item is highlighted and the details section is hidden. Click an opportunity: it becomes the highlighted item and its amount and close date appear below the menu.

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

The menu is empty

Run the flow in Debug and check that Get_Opportunities returned records for that account. Then check that Get Opportunities is selected under Items Collection and that Label is mapped: an item with no label shows nothing.

A field in the details section is blank

Active Navigation Item SObject only carries the fields the Get Records element stored. If you chose specific fields, add the ones the Display Text reads.

The stage does not show under the name

Description only renders in a vertical menu. Set Orientation to Vertical.

Last updated

Was this helpful?