Create a Dynamically Linked Account-Contact View
Last updated
Last updated
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.
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).
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.
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.
Connect this formula variable to the "Filter" field in the Query Data Source settings of the right-side Data Table.
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.
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