Dynamic Filters allow users to refine the data displayed in a Dynamic Grid without writing code. Filters can be linked to Data Sources and applied to Dynamic Grid Data Sources for interactive, user-driven experiences.
Overview
Dynamic Filters:
-
Enable users to narrow down results in a Dynamic Grid.
-
Work with SOQL-based Data Sources or Apex-based Data Sources.
-
Are configured using Custom Metadata Types.
Prerequisites
-
Dynamic Grid and Data Sources must already be configured.
-
Ensure profiles have access to Apex classes:
-
DynamicGridUi -
DataSourceUi
(Setup > Profiles > Apex Class Access)
-
Steps to Configure Dynamic Filters
Step 1: Create Filter Metadata
-
Navigate to Setup > Custom Metadata Types.
-
Select Dynamic Grid Filter and click Manage Records.
-
Click New and provide:
-
Label and Name (meaningful values).
-
Filter Type:
-
Picklist (for predefined values).
-
Text (for free text input).
-
Checkbox (for boolean filters).
-
-
Field API Name: The field in the object to filter on.
-
Operator: Equals, Contains, Starts With, etc.
-
Default Value (optional).
-
-
Click Save.
Step 2: Link Filter to Data Source
-
Go to Dynamic Grid Data Source metadata records.
-
Edit the record and add the filter reference in the Filter section.
-
Ensure the filter matches the fields available in the Data Source query.
Step 3: Add Filter Component to Member Portal
-
Open Experience Builder.
-
Select the Dynamic Grid that you want to contain a filter
-
From the Dynamic Grid configuration menu, select “Display Filters”
Step 5: Publish the Site
Best Practices
-
Use Picklist filters for controlled values.
-
Combine multiple filters for advanced search.
-
Validate SOQL queries to ensure filters work correctly.
Troubleshooting
-
If filters don’t apply:
-
Check that the filter field exists in the Data Source query.
-
Verify metadata records are active.
-
Confirm Apex class permissions.
-