Create a Dynamically Linked Account-Contact View
Overview
In this tutorial, you'll learn how to build a Flow showing a list of accounts on the left and their related contacts on the right. Whenever you select an account, the contact list automatically updates to show only the contacts for that account.
Guided Steps
Flow Layout
Start by creating a flow with a two-column section.
Place an Avonni Data Table component in the left column. This table will display a list of accounts.
Place another Avonni Data Table component in the right column. This table will display the contacts related to the selected account(s).
Dynamic Query
Configure the right-side Data Table to use a dynamic query. This query will filter contacts based on the
selectedRowsKeyValueCommaSeparated
attribute from the left-side Data Table.
Formula Text Variable (WHERE Clause)
Create a formula text variable to build the WHERE clause for your query dynamically. The formula should look like this:
The query will filter records based on the Account IDs selected in the left-side Data Table.
Mapping to Query Data Source
Connect this formula variable to the "Filter" field in the Query Data Source settings of the right-side Data Table.
Troubleshooting
To ensure your formula works as intended, you can use a Display Text element to see the actual value your formula returns. This helps you confirm if the result makes sense and can be used effectively in a SOQL query.
Result
Now, whenever you select one or more accounts in the left-side Data Table, the right-side Data Table will automatically update to show the relevant contacts. This creates a seamless, user-friendly way to view and manage relationships between accounts and contacts in your Flows
Last updated