Show an account hierarchy
Show the whole customer group around the account the user is on, parent and subsidiaries, in a screen flow Tree Grid built from one query.
An account manager opens Meridian Chicago Hub and wants to know where it sits in the customer group: which company it reports to, which sister hubs exist, how much revenue each one brings. With the Tree Grid in Hierarchy mode, a screen flow on the Account page shows the whole group from the top, with the branch down to Meridian Chicago Hub already open and its row marked.

Before you start
Your accounts use the standard Parent Account field, so each subsidiary points at its parent.
Your screen flow has a
recordIdinput variable (Text, available for input) and runs on the Account record page with Pass record ID into this variable checked. If not, follow How to pass your current RecordID in your screen flow.Avonni Flow Components is installed in your org.
Steps
Add the Tree Grid to a screen
In Flow Builder, add a Screen element and drag the Avonni Tree Grid onto it.
Select it and click Open Component Builder.
In the Header group of the Properties tab, set Title to
Customer group.Turn on Show Number of Children, in the same tab, so each parent row shows how many companies sit below it.
Query the Account object
Open the Data Source section of the Properties tab, just above Data Mappings, and choose Query.
Set Object API Name to
Account.Under Order By, add Account Name, ascending, so sister companies read in alphabetical order.
Leave Filters empty for now. In this mode they apply at every level of the hierarchy, so a filter on the top account also hides subsidiaries that do not match it.
Switch the query to Hierarchy mode
In the query editor, set Mode to Hierarchy.
Set Parent Lookup Field to Parent Account ID.
There is no level to add: with the lookup chosen, the grid reads parents and children from the same object, as deep as the hierarchy goes. The list only offers lookups from Account to Account.

Give the grid the account the user is on
In the Properties tab, open the Hierarchy group. It sits between No Results Message and Data Source.
Map Current Record ID to your flow's
recordIdvariable (the picker shows it as Record Id).
The grid climbs from that account to the top of its group, then opens the branch back down to it. Without a value it shows no rows at all.

Choose the columns
Under Data Mappings, add one entry per column, all on Account:
Account Name
Text
First column: it carries the toggles and the tree.
Account Type
Text
Direct customer or channel.
Billing City
Text
Where each company sits.
Employees
Number
Size at a glance.
Annual Revenue
Currency
Compare the companies of the group.
For the two number columns, open Cell Attributes and set Alignment to right, so the figures line up.
Save and test
Save and activate the flow.
Open Meridian Chicago Hub (or any account with a parent) and run the flow from its page.
You see Meridian Group as the only top row. Its branch is open down to Meridian North America, then Meridian US Logistics, then Meridian Chicago Hub, which carries a grey current badge. Meridian Atlanta Hub and Meridian Dallas Hub sit beside it. Meridian Europe stays closed until the user opens it; Meridian Asia Pacific has no subsidiaries, so it has no toggle.
With Show Number of Children on, each parent row carries a count in brackets: Meridian Group reads (10), and the three branches below it read Meridian Europe (2), Meridian North America (5) and Meridian US Logistics (3). In Hierarchy mode that count covers the row's whole subtree, not only the companies directly under it.
To test from Flow Builder instead, see Test a screen flow that needs a record Id.
Troubleshooting
Related tutorials
Browse accounts, contacts and cases: open each company onto its contacts and their open cases.
Work with selected rows: let the user tick accounts of the group and update them after the screen.
Add row and header actions: open an account of the group from its row.
Filter a Data Table or Map by the current record: the same
recordId, used in a query filter.
Last updated
Was this helpful?
