Query VS Variable
Last updated
Was this helpful?
Last updated
Was this helpful?
When building your Salesforce flows with Avonni components, selecting the right data source is crucial for performance and flexibility. Avonni offers two main options:
You fetch data using standard Salesforce Flow elements (like "Get Records") and store it in a variable. Then, you connect this variable to your Avonni component (e.g., Data Table, List).
Simpler use cases where you need data from a single object or a few related objects.
When you have existing Flow logic for fetching data and want to reuse it.
If you need to manipulate or transform the data before displaying it.
Limited to 50,000 records retrieved by the "Get Records" element.
Not suitable for complex queries with multiple objects or conditions.
You write a Salesforce Object Query Language (SOQL) query directly within the Avonni component. This query fetches the data you need.
Complex queries involving multiple objects, relationships, or filters.
When you need to retrieve more than 50,000 records.
If you want to create dynamic, interactive components that filter data in real-time based on user input.
Requires basic knowledge of SOQL.
Might be less intuitive for beginners than using variables.
Data Source
Flow variable
SOQL query
Record Limit
50,000
No limit
Query Complexity
Limited
High
Real-Time Filtering
Not directly
Yes
Ease of Use (for beginners)
Easier
May require learning curve
Variable: Use a "Get Records" element to fetch contacts based on certain criteria (e.g., Account Name). Store the results in a variable and connect it to an Avonni List component.
Query: Write a SOQL query directly in the Avonni List component: SELECT Id, Name, Email FROM Contact WHERE Account.Name = 'Acme'
To make the best decision for your specific use case, consider the complexity of your data needs, the amount of data you need to retrieve, and your comfort level with SOQL.