Query
Avonni Query Data Source
The Avonni Query Data Source lets you connect Avonni components (Data Table, List, Carousel, Map) to your Salesforce data within App & Record Pages. It offers a flexible and efficient way to retrieve and display data, giving you precise control over what's shown and how.
Core Concepts
What is the Avonni Query Data Source?
The Avonni Query Data Source is a powerful way to connect your Avonni components (such as Data Table, List, Carousel, and Map) directly to your Salesforce data. It provides a flexible and efficient method for retrieving and displaying data within your App & Record Pages, giving you fine-grained control over what data is shown and how it's presented.
Reusable Queries
You can create a Query as a reusable resource and then use that same query across multiple Avonni components within your Dynamic Component. This promotes consistency and simplifies maintenance.
Permissions
A query runs with the permissions of the person viewing the page
An Avonni Query is executed in the context of the logged in user, not the person who built the component. Object access, field level security and sharing rules all apply, so the same page can show different results to different users. The component displays exactly what Salesforce returns for that user.
It is also why a query can work perfectly for you as an administrator and return nothing, or fail, for a standard user.
Relationships on the User object that need an extra permission
Two relationships on the User object stay hidden from users who do not hold a specific permission:
Profile(for exampleProfile.Name) needs View All Profiles or View Setup and Configuration.UserRole(for exampleUserRole.Name) needs View Roles and Role Hierarchy.
If your query selects or filters on one of them and the viewing user does not have the permission, Salesforce rejects the relationship and the component shows an error similar to this one:
Errors while executing the query: No such relation 'Profile' on entity 'User'
Everything that depends on that query goes empty at the same moment. A Kanban filtered on the rows selected in a Data Table, for example, has nothing left to filter on and shows no records, which usually looks like the second component being the broken one.
There are two ways to fix it:
Take the relationship out of the query. Filter on the record Id, a public group, or a custom field on the User record instead. This works for every user without changing any permission, and it is the option to prefer.
Grant the permission. Add View All Profiles (plus View Roles and Role Hierarchy if the query uses roles) to a permission set, assign it, and validate with one affected user before rolling it out.
The query works for admins but not for standard users
Check permissions before looking at the component. An administrator bypasses most of these checks, so testing your page with a profile your users actually have is the fastest way to see what they see. If the component is hidden altogether rather than empty, look at its visibility condition instead: see Component Visibility.
Managing Queries
Creating a Query
There are two ways to create a new Avonni Query:
Via the Resources Button: Click the Resources button and create a new Query Resource.
From an Avonni Component: Select the component (e.g., Data Table), and in its properties, click the "Create a Query" button
Editing a Query
You can modify an existing Avonni Query in two ways:
From the Resources Menu:
Click the Resources button.
Locate the Query you want to edit in the list of resources.
Select the option to edit the Query by clicking on the Query name.
From an Avonni Component:
Select the Avonni component (e.g., Data Table, List) currently using the Query.
Find the section related to the data source or query in the component's properties panel.
Look for an option to edit the Query (this is an "Edit" button).
Important Note
Modifying an existing Query will affect all Avonni components within your project using that same Query. This is because Queries are reusable resources.
Creating a New Version (Recommanded)
If you want to make changes to a Query without affecting other components, use the "Save As" or "Duplicate" option (if available) to create a new copy of the Query. Then, modify the latest copy.
Filtering Data
Configuring Query Filters
Avonni Dynamic Components allow you to filter the data retrieved by your queries, similar to using a WHERE clause in a SOQL query. This lets you control which records are displayed in components like Data Tables, Lists, and Maps.
Types of Filters
Static Filters: These filters use fixed values. You define them directly in the query's filter panel by selecting a field, an operator, and a specific value (e.g.,
Location equals 'New York'). Static filters do not change automatically based on user interactions.Reactive Filters: These filters use dynamic values that do change based on user interactions or changes in other components. Instead of entering a fixed value, you reference an attribute of another component on the page (e.g.,
@AccountsTable.firstSelectedRow.Id). This creates a dynamic link, so the query automatically updates whenever the referenced attribute changes. See the [Reactive Queries documentation](Insert Link to Reactive Queries Section Here) for more details.
Setting Up a Static Filter (Example)
To retrieve Contact records where the Location is 'New York':
Select the Component: Choose the component you want to filter (e.g., a Data Table displaying Contacts).
Open the Filter Panel: In the component's properties panel, find and open the section for configuring the data source and its filters.
Add a Filter Condition:
Field: Select the
Locationfield (or the field containing the location information).Operator: Choose the
equalsoperator.Value: Enter the text
'New York'(including the single quotes for a text value).
This setup will filter the component to show only Contacts where the Location field is equal to 'New York'
Grouping Filter Conditions
You can create more complex filters by grouping conditions using AND and OR logic. For example, to retrieve Contacts where the Location is 'New York' OR 'San Francisco', AND the Status is 'Active':
Create a Group: Use the grouping feature in the filter panel (usually represented by buttons or options to group conditions).
Add Conditions to the Group:
Location equals 'New York'Location equals 'San Francisco'
Set Group Operator: Change the operator of the created group to
OR.Add Another Condition (Outside the Group):
Status equals 'Active'
By default, the condition and the group will be combined using
ANDoperator.
Available Filter Operators
The Avonni Query Data Source supports a range of operators for creating precise filters:
Comparison Operators:
equals( = )not equal to( <> or != )less than( < )greater than( > )less than or equal to( <= )greater than or equal to( >= )
String Operators:
containsstarts withends with
Set Operators:
innot in
Logical Operators (for Grouping):
ANDORNOT
Filtering on an Empty Field
There is no is empty or is null operator in the list above, because the null goes in the value rather than in the operator:
Add a filter condition on the field and choose the equals operator.
Open the value picker, expand Global Constants, and select Null.

The field is then compared against a real null, which is what filtering on an empty field means. Use not equal to with the same value for the opposite case.
Typing the word NULL into the value box is a different thing and does not work: it is compared as the text NULL, so the condition matches no records.
A formula field is worth considering when you want the test itself to be reusable across queries, or when the condition is more than a simple blank check. In Setup, add a formula field on the object with Checkbox as the return type, write the formula for the case you want, for example ISBLANK(ParentId) to identify records that have no parent, then filter on that field with equals set to true. Formula fields appear in the filter field picker like any other field, and a checkbox formula filters exactly the way a stored checkbox does.
A filter that cannot resolve its value returns no records, not an error
When a filter value cannot be resolved, the query still runs and comes back empty. Nothing is logged and no message is shown, so an empty component looks the same whether the filter is wrong or the data genuinely has no match.
The most common cause is a {!$Component.Record.FieldName} reference evaluated where there is no record in context. The Component Builder preview is one of those places: it has no record behind it, so every reference to the current record is empty there. Test a filter that uses the current record on an actual record page, not in the preview.
When a single condition is combined with others using AND, one unresolved value empties the whole result. Removing the other conditions and testing that one on its own tells you which of them is at fault.
Reactive Queries
Introduction to Reactive Queries
Reactive queries are a core feature of Avonni Dynamic Components, enabling your components (like Data Tables, Lists, Maps, etc.) to automatically update their displayed data based on user interactions or changes in other components. This creates a dynamic and responsive user experience without requiring manual page refreshes. All Avonni Dynamic Components are natively reactive-ready.
How Reactive Queries Work
Reactive queries in Avonni Dynamic Components automatically update data in a component (like a Data Table, List, or Map) based on changes in other components on the page. This is achieved without needing to write complex formulas. Instead, you directly reference the attributes of other components within the query's filter.
Direct Attribute Referencing
When configuring a query's filter, you can select attributes from other components on the page. For example:
If you have a Data Table displaying Accounts (let's call it
AccountsTable) and another Data Table displaying Contacts, you can configure the Contacts Data Table's query to filter based on the selected row in theAccountsTable.In the Contacts Data Table's filter, you would select the
AccountIdfield (or the relevant field linking Contacts to Accounts).For the filter's value, you would directly reference the
Idattribute of the selected row in theAccountsTable. This might look something like:@AccountsTable.firstSelectedRow.Id.When a user selects a different row in the Accounts Table, the value from the selected row attributes will dynamically change, making the Contact Table reactive.
Automatic Updates
Whenever the referenced attribute's value changes (e.g., a new row is selected in the AccountsTable), the query automatically re-executes, and the connected component (the Contacts Data Table) updates to display the new results.
Last updated
Was this helpful?
