The native account hierarchy covers accounts only, on its own page. How to show any hierarchy as a tree grid, on a page or in a flow.

Salesforce has a native account hierarchy view, but it covers accounts only and opens on its own page. To show a hierarchy on a record page, inside a Screen Flow, on a custom object, or across several objects at once, you need a tree grid: a table whose rows expand to reveal the records below them. You can build one with code, or configure one without it. This post covers both, and what the native view already does well.
Add the Avonni Tree Grid to record, app and home pages without code. Start free with 10 production licenses.
Install free from AppExchangeOn any account with a parent, the View Account Hierarchy action opens a page that shows the whole family: the parent, its children, and theirs. Admins pick up to 15 columns for it, and it displays up to 2,000 accounts. For a quick look at who owns what in a group of companies, it does the job.
Its limits show up as soon as the hierarchy becomes part of someone's daily work:
Salesforce's Lightning component library includes lightning-tree-grid, a base component that renders hierarchical rows. A developer writes the Lightning Web Component around it, plus the Apex that queries each level and assembles the nested data. It works, and it is yours to maintain: every new level, column or object is a code change.
Avonni's Tree Grid does the same job without code. It exists as a Dynamic Component, for Lightning record, app and home pages, as a Flow Screen Component, for Screen Flows, and natively in Experience Builder, for portals. You configure it visually, level by level.

The levels don't have to use the same object. An account can expand into its opportunities, and each opportunity into its contact roles or products. Each level is a query on the child object, linked to its parent by a relationship field.
Since the October 2026 release, the Tree Grid can also climb. Turn on Hierarchy mode, pick Parent Account ID as the lookup and pass the record Id of the page: opened from any account, the grid goes up to the top of that branch, draws the whole tree and marks the account you came from. Deeper levels load as users open them. Without Hierarchy mode, the tree still builds downward from the records its first query returns.
| Native account hierarchy | Custom LWC | Avonni Tree Grid | |
|---|---|---|---|
| Objects | Accounts only | Any | Any, and several in one tree |
| Where | Its own page | Anywhere you deploy it | Record, app and home pages, Screen Flows, Experience sites |
| Columns | Up to 15 | Your choice | Your choice, with display types |
| Actions | None | Your choice | Row actions and header buttons |
| Direction | Parents and children | Your choice | Up to the top and down, with Hierarchy mode |
| Code | None | LWC and Apex | None |
Yes. Any object with a lookup to itself works the same way as Parent Account ID: add a nested level on the same object with that lookup as the relationship field.
You add one nested level per generation. One of our customers runs a five-level account hierarchy built on Parent Account ID: group, subgroup, account, sub-account and agent code.
Yes. Each level queries its own object, so a tree can go from accounts to opportunities to contacts.
Yes, with Hierarchy mode, shipped in October 2026. Give the Tree Grid the Parent Account ID lookup and the current record Id: it climbs to the top of the branch and draws the tree from there.
The Tree Grid is part of Avonni Dynamic Components for Lightning pages, of the Avonni Flow Screen Components for Screen Flows and of the Avonni Experience Cloud Components for portals. Install it from the AppExchange and build your first hierarchy in minutes. See the Tree Grid on every surface, filmed in real orgs. For every Screen Flow component, native and third party, see the Salesforce Flow Screen Components guide.

Co-founder of Avonni and Head of Engineering, Jean-Baptiste has spent 8+ years building the next generation of low-code development tools for Salesforce. He leads the technical vision behind Avonni's interactive prototyping and component builder platform.
Follow on LinkedIn →Start free with 10 production licenses. All 3 Avonni packages included.