> 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/dynamic-components/tutorials/components/data-table/add-user-filters.md).

# Add User Filters

Give users filter menus on a Data Table, with a value preselected on load, so a service manager opens the case list already narrowed to what matters.

A service manager starts each morning on the open cases. The list is long, and what matters first is the High priority work, then a given status. With user filters, the table opens with Priority already set to High, and the manager switches Status between New and Escalated in two clicks, without asking an admin for another list view.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FBZKWB8gYozyvIqeYB91U%2Fdata-table-tutorial-add-user-filters-result.png?alt=media" alt="Case table with the Priority filter set to High and the five matching cases"><figcaption><p>The table opens with Priority already set to High: five cases.</p></figcaption></figure>

## Before you start

* A [Data Table](/dynamic-components/components/data-table.md) on Case with a [Query](/dynamic-components/component-builder/data-sources/query.md) or Variable data source. User filters are not available with Manual data.
* Columns mapped for at least Case Number, Subject, Priority and Status.

## Steps

{% stepper %}
{% step %}

### Add the fields users can filter on

1. Select the Data Table on the canvas.
2. In the Properties panel, open the **Data Mappings** section.
3. Under **Filters**, click **Add Filters** and set **Filter By** to `Priority`.
4. Add a second item with **Filter By** set to `Status`.

Each field can be used once.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2F6hHC1qyxMKbZtuO6m7t8%2Fdata-table-tutorial-add-user-filters-filters-collection.png?alt=media" alt="Filters collection with Priority and Status, the Priority filter open with High as its default value" width="480"><figcaption><p>Each filter names a field and can carry a default value.</p></figcaption></figure>
{% endstep %}

{% step %}

### Preselect High priority

Click the `Priority` item and set **Default Value (Optional)** to `High`.

The table now loads already filtered. The manager can still change or clear the value. The default value editor follows the field type:

| Field type                           | Default value                           |
| ------------------------------------ | --------------------------------------- |
| Picklist, multi-select picklist      | One or several values from the picklist |
| Text, text area, ID, lookup, address | One or several values, typed            |
| Checkbox                             | True or False                           |
| Number, currency, percent            | A number                                |
| Date, date/time                      | A date                                  |
| Time, email, phone, URL              | One value                               |

Leave the field empty to start unfiltered.
{% endstep %}

{% step %}

### Rename a filter (optional)

A filter is labelled with the field name. To show something else, open the item's advanced options, turn on **Custom Label** and type the **Label**, for example `Case status` instead of `Status`.
{% endstep %}

{% step %}

### Choose where the filters appear

Open the **Filter** section of the Properties panel and set **Type**:

* **Horizontal** (default): one menu per filter, in the table header.
* **Popover**: a single filter button in the header that opens all the filters.
* **Panel**: the filters move to a side panel. Set its side (**Left** or **Right**), **Closed by Default** and **Reset Button Label** in the **Side panel** section.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FKftXDOhqziTX8h21OJyD%2Fdata-table-tutorial-add-user-filters-panel.png?alt=media" alt="Case table with the Priority and Status filters in a side panel on the left"><figcaption><p>With Type set to Panel, the filters move to a side panel.</p></figcaption></figure>
{% endstep %}

{% step %}

### Keep the options relevant (optional)

Still in the **Filter** section:

* **Use Record Picklist Values**: a picklist filter lists only the values found in the records, instead of every value defined on the field. A status no case uses, such as Working, disappears from the menu.
* **Use Cascading Filter Values**: picking a value in one filter narrows the options of the others. With Priority set to High, the Status menu lists only the statuses of High priority cases. When this is on, Use Record Picklist Values is ignored.
  {% endstep %}

{% step %}

### Save and test

Save the component and open the page. The table shows only High priority cases and the Priority menu shows `High` as selected. Pick `New` in Status: only the new High cases remain. Clear Priority: every new case appears, whatever its priority. The builder canvas ignores default values and lists every record, so test on the page itself.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Quicker, without defaults:** turning on **Filterable** on a column in **Data Mappings** also adds that field to the filters, and **All Columns Filterable** (advanced options of the **Content** section) does it for every column. Use the **Filters** collection when you need a default value, a custom label, or a filter on a field that is not a column.
{% endhint %}

## Filters or search?

Filters and search ([Set Up Search](/dynamic-components/tutorials/components/data-table/set-up-search.md)) can sit on the same table, and they answer different needs.

* **Filters** pick from known values (a priority, a status, a date). Use them when the user narrows by category, and when the table should open pre-filtered.
* **Search** matches free text the user types (part of a subject or a name). Use it when the user is looking for one record.

## Troubleshooting

<details>

<summary>The Filters collection is missing from Data Mappings</summary>

The data source is Manual. User filters need a Query or Variable data source.

</details>

<details>

<summary>A field is not offered in Filter By</summary>

Filter By lists only the fields Salesforce allows in a filter. Long Text Area and Rich Text Area fields (Case Description, for example) are not filterable.

</details>

<details>

<summary>I chose Horizontal or Panel, but the filters show as a popover</summary>

When the Data Table is narrow, the filters always fall back to a popover. Give the component more width on the page.

</details>

## Related tutorials

* [Set Up Search](/dynamic-components/tutorials/components/data-table/set-up-search.md): add a free-text search next to the filters, in the same side panel if you like.
* [Configuring Data Grouping](/dynamic-components/tutorials/components/data-table/configuring-data-grouping.md): group the filtered cases by status.
* [Data Table](/dynamic-components/components/data-table.md): the reference for every Filter and Side panel property.


---

# 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/dynamic-components/tutorials/components/data-table/add-user-filters.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.
