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

Filter a Data Table or Map by the current record in a screen flow

Show only the current record's Cases or Contacts in an Avonni Data Table or Map, with a recordId query filter in your screen flow.

A support agent opens an Account and wants its open Cases in a table, and its Contacts on a map, without searching. Your screen flow already receives the Account Id in recordId. Here you point an Avonni Data Table and an Avonni Map at that Id, with no Get Records element in between.

Avonni Data Table in a screen flow showing only the three open Cases of the current Account, filtered with recordId
Open Cases of the Account the user is looking at.

Before you start

Steps

1

Add a Data Table to a screen

In Flow Builder, open a Screen element, drag the Avonni Data Table onto it and open the Component Builder.

2

Set the data source to Query

In the Properties tab, set Data Source to Query and choose the object to list: Case. The query runs when the screen loads, so the table always shows current data.

3

Filter on the record Id

Under Filters, click Add Condition:

  • Field Account ID, operator Equals, value: the recordId resource of your flow.

  • Click Add Condition again: Closed Equals False, to keep open Cases only.

The builder lists fields by label, so look for Account ID rather than the API name AccountId.

Avonni Data Table Data Source in the Flow Component Builder: Query on Case, filters Account ID Equals {!recordId} and Closed Equals false
The query filter reads the flow's recordId.

Filter on the field that points to the page's record. On the Account page that is the lookup AccountId on Case, not the Case's own Id.

4

Choose the columns

In Data Mappings, add the fields to show, for example Case Number, Subject, Status and Priority. Column types and options are on the Data Table page.

5

Do the same for a Map

Add an Avonni Map to the screen, set Data Source to Query on Contact, and add the same condition: AccountId Equals the recordId resource. Then map the address fields so each Contact gets a marker, as described on the Map page.

Avonni Map in a screen flow showing four markers in Seattle, one for each Contact of the current Account, filtered by recordId
The same filter on a Map: the Account's Contacts only.
6

Save and test

Save and activate the flow, then open an Account. The table lists only that Account's open Cases and the map only its Contacts. Open a second Account: both change with it.

Troubleshooting

The table is empty on the record page

recordId is not reaching the flow, so the filter compares AccountId with an empty value. Check the checkbox on the Flow component in Lightning App Builder. If the flow runs from Flow Builder, see Test a screen flow that needs a record Id.

The table is empty although the Account has open Cases

The condition is on the Case's Id instead of the lookup field. No Case has the Account's Id as its own Id, so nothing matches. Filter Cases or Contacts on AccountId.

The map ignores the filter

The Map's Data Source is Variable: no query, so no query filter applies. Switch it to Query, or filter the collection with a Get Records before the screen.

Was this helpful?