> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/experience-cloud/properties-panel/data-sources/query.md).

# Query

## Overview

The Query Data Source enables Avonni Data Components—such as [**Data Table**](https://docs.avonnicomponents.com/experience-cloud/tutorials/components/data-table.md), [**List**](https://docs.avonnicomponents.com/experience-cloud/experience-components/ax-list.md), [**Gallery**](https://docs.avonnicomponents.com/experience-cloud/experience-components/ax-gallery.md), and Map—to dynamically retrieve and display Salesforce record data on Experience Cloud sites.

This data source is designed for situations where content must stay in sync with Salesforce data and respond dynamically to user interactions on the page.

***

## What is the Avonni Query Data Source?

The Avonni Query Data Source connects Avonni components directly to **Salesforce objects** via a configurable query, similar in concept to SOQL but built visually.

In an Experience Cloud context, it enables:

* Dynamic data retrieval from Salesforce records
* [**Reactive behavior**](https://docs.avonnicomponents.com/experience-cloud/getting-started/reactive-components.md) between components on the same page

***

## Creating a query

Queries are created **directly from an Avonni component**.

To create a new Query:

1. Select an Avonni Data Component (for example, a **Data Table** or **List**) in Experience Builder
2. In the component’s properties panel, open the **Data Source** section
3. Select **Query** as the data source
4. Configure the query fields, filters, and options

***

## Permissions

A query runs with the permissions of the person viewing the page. That user's object access, field-level security and sharing rules decide which records and fields come back, and a browser request cannot ask for more access than the user has.

On a public site, visitors who are not logged in are guest users, so their queries run with the guest user profile's access. If a list stays empty for visitors but fills for logged-in users, check what the guest user profile can read.

Two things follow when you build a page:

* Two users can see different results from the same query. A sales manager may see every opportunity in a Data Table while a partner user sees only the ones shared with them.
* A query cannot read a custom setting, including the protected settings of installed packages. Use a custom object when a component needs to display configuration data.

***

## Filtering data

### Configuring query filters

Filters allow you to control which Salesforce records are returned by the query, similar to a `WHERE` clause in SOQL.

Filters are configured directly in the query editor and apply to all components using that query.

***

### Types of filters

**Static filters**

Static filters use fixed values defined at configuration time.

Example:

* Field: `Location`
* Operator: `equals`
* Value: `New York`

Static filters do not change unless the query is edited.

***

## Reactive queries

**What are reactive queries?**

Reactive queries enable Avonni components on an Experience Cloud page to automatically update in response to user interactions or changes in other components.

This enables highly dynamic, interactive pages without page reloads or custom code.

<a href="https://docs.avonnicomponents.com/experience-cloud/getting-started/reactive-components.md" class="button primary" data-icon="square-info">Learn More</a>

***

## When to use the Query Data Source

Use the Query Data Source when:

* Data must stay synchronized with Salesforce records
* Content must react to user interactions
* Multiple components need to share the same dataset
* Filtering and grouping logic is required

For static or editorial content, consider using [**Manual**](https://docs.avonnicomponents.com/experience-cloud/properties-panel/data-sources/manual.md) or [**CMS Collection**](https://docs.avonnicomponents.com/experience-cloud/properties-panel/data-sources/cms-collection.md) data sources instead.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/experience-cloud/properties-panel/data-sources/query.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
