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

Browse accounts, contacts and cases

Open each subsidiary onto its contacts and each contact onto their open cases, in one screen flow Tree Grid on the Account page, with three linked queries.

Before a quarterly review with Meridian US Logistics, an account manager wants to see each of its hubs, who the contacts are there, and which of those contacts have open cases. With the Tree Grid in Multi-Level mode, one screen flow on the Account page answers it: hubs at the top, contacts under each hub, open cases under each contact.

A Tree Grid in a screen flow listing three hubs of Meridian US Logistics, one opened onto its contacts and one contact opened onto two open cases with status and priority
Hubs, then their contacts, then each contact's open cases, from three linked queries.

Before you start

  • Your screen flow has a recordId input 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.

  • The account has subsidiaries (accounts whose Parent Account points at it), and they have contacts and cases.

  • If what you need is the account's own parents and subsidiaries, with no other object, Show an account hierarchy is simpler.

Steps

1

Add the Tree Grid to a screen

  1. In Flow Builder, add a Screen element and drag the Avonni Tree Grid onto it.

  2. Select it and click Open Component Builder.

  3. In the Header group, set Title to Hubs, contacts and open cases.

2

Query the subsidiaries for the top level

  1. Open the Data Source section of the Properties tab, just above Data Mappings, and choose Query.

  2. Set Object API Name to Account.

  3. Under Filters, click Add Condition: Parent Account ID Equals your flow's recordId resource.

  4. Under Order By, add Account Name, ascending.

Opened from Meridian US Logistics, this level returns its three hubs.

3

Add the contacts under each account

  1. In the query editor, leave Mode on Multi-Level.

  2. Under Child Items, click Add Item.

  3. Set Child Object API Name to Contact and Relationship Field to Account ID.

  4. Under Order By, add Last Name, ascending.

The Relationship Field is the lookup on the child that points at the level above. Here, each Contact's Account ID points at its hub.

4

Add the open cases under each contact

  1. Open the menu of the Contact entry and choose Add. The new entry is created under it, one level deeper.

  2. Set Child Object API Name to Case and Relationship Field to Contact ID.

  3. Under Filters, click Add Condition: Closed Equals false.

Choose Contact ID, not Account ID: the level above is now a contact.

The Child Items list of the Tree Grid query editor with Case nested under Contact, and the Case entry open on Relationship Field Contact ID and a Closed equals False filter
Case sits under Contact and ties to it with Contact ID.
5

Choose the columns

Under Data Mappings, add these columns, in this order:

Object API Name
Source Field
Type

Account

Account Name

Text

Account

Annual Revenue

Currency

Contact

Title

Text

Contact

Email

Email

Case

Status

Badge

Case

Priority

Text

Each column reads one object, so it stays empty on the rows of the other two. The first column is the exception: because it reads the account's name field, every row shows its own name there. Hubs show their account name, contacts their full name, cases their case number.

Turn on Custom Label on the first column and set Label to Name, since it no longer holds only accounts.

6

Save and test

  1. Save and activate the flow.

  2. Open Meridian US Logistics and run the flow from its page.

You see three rows: Meridian Atlanta Hub, Meridian Chicago Hub and Meridian Dallas Hub, with their annual revenue. Open Meridian Chicago Hub: its contacts appear with their title and email. Open a contact: their open cases appear with status and priority. A contact with no case at all has no toggle.

To list an account's cases directly under it, beside its contacts, add the Case entry under Child Items with Add Item (not from the contact's menu) and Account ID as its Relationship Field. Each hub then opens onto two rows, Contacts and Cases, and the records sit under them. Turn on Show Number of Children in the Properties tab to print each row's count beside its label.

Troubleshooting

"Please select an object and a relationship field for each query."

One entry under Child Items is missing its Child Object API Name or its Relationship Field. Open each entry and fill both.

The grid is empty

The top level found no account. Check that the flow receives recordId (see Test a screen flow that needs a record Id), and that the condition reads Parent Account ID, not Account ID: an account with no subsidiary returns nothing at this level.

Contacts open, but no contact has a toggle

The Case entry ties to the wrong field. Under a contact, the Relationship Field must be Contact ID. Also check that the entry sits under Contact and not beside it.

Case is not in the child object list

The list starts with the objects related to the level above. Turn on All Objects next to Child Object API Name to search every object.

Columns are blank on some rows

Expected: an Account column has nothing to show on a Contact or Case row. Keep the first column on the name field so every row still has a label.

Last updated

Was this helpful?