> 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/flow/tutorials/components/data-table/adding-filters.md).

# Adding filters

Add Stage and Owner filters to a screen flow Data Table so users narrow a long list of deals themselves, with the filters above the table or in a side panel.

A sales manager opens a screen flow to reassign deals, and the table lists 150 open Opportunities. Filters on **Stage** and **Opportunity Owner** let the manager narrow it to one rep's late-stage deals in two clicks, without you building a second screen.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FqhMJlOYXBhrZ4WobDDZp%2Fdata-table-tutorial-adding-filters-result.png?alt=media" alt="Data Table with the Stage filter open and two stages selected"><figcaption><p>Filters on Stage and Owner narrow the list on the screen.</p></figcaption></figure>

## Before you start

* A screen flow with an Avonni Data Table listing Opportunities, with a **Query** or **Variable** data source. See [Learn the Basics](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/learn-the-basics.md) and [Data Source](https://docs.avonnicomponents.com/flow/flow-components/data-table.md#data-source).
* The columns you want to filter on are already in the table, or you know which fields to add as filters.

## Steps

{% stepper %}
{% step %}

### Turn on a filter for a column

1. Select the Data Table on the screen and click **Open Component Builder**.
2. In the preview, click the chevron on the **Stage** column header.
3. Choose **Allow Filtering**.

Do the same on **Opportunity Owner**. To remove a filter, open the menu again and choose **Disallow Filtering**. To make every column filterable at once, tick **Filterable** in the toolbar's **All Columns Settings**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F1mLTNBQgjzgUqESuA5cW%2Fdata-table-tutorial-data-table-editor-result.png?alt=media" alt="Column header menu of the Data Table in the Component Builder" width="320"><figcaption><p>Every column setting opens from the chevron on its header.</p></figcaption></figure>
{% endstep %}

{% step %}

### Add a filter on a field that is not a column

The user may need to filter on a field you do not want to show, such as **Type**.

1. In the **Properties** tab, under **Data Mappings**, open **Filters** and add one.
2. In **Filter By**, pick the field.
3. Optional: under **Advanced Options**, turn on **Custom Label** and type a **Label** to show in place of the field name, for example `Deal type`.
   {% endstep %}

{% step %}

### Choose where the filters show

In the **Properties** tab, open the **Filter** group and set **Type**:

| Type                     | What the user sees                                   |
| ------------------------ | ---------------------------------------------------- |
| **Horizontal** (default) | The filters in a row above the table.                |
| **Popover**              | The filters open in a popover from the table header. |
| **Panel**                | The filters in the table's side panel.               |

The same group also orders picklist options and can narrow them to the values in the table's records, or to the values that still match the other filters: see [Filter](https://docs.avonnicomponents.com/flow/flow-components/data-table.md#filter) in the reference.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FmuxLYKkpEQerP4aSyZhS%2Fdata-table-tutorial-adding-filters-filter-type.png?alt=media" alt="Filter group of the Properties tab with the Type setting" width="320"><figcaption><p>The Filter group sets where the filters show.</p></figcaption></figure>
{% endstep %}

{% step %}

### Save and test

Click **Save**, then **Done**, and run the flow in debug. Open the **Stage** filter, tick **Proposal/Price Quote** and **Negotiation/Review**: the table keeps only the deals at those stages. Add an Owner on top, and both filters apply together.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
These filters narrow what the user sees on this screen. The Data Table has no output for the values the user picked, so a later element cannot read them. When the flow needs the choice, put a combobox on the screen and let it drive the query: see [Filter data tables with multi-select comboboxes](https://docs.avonnicomponents.com/flow/tutorials/components/combobox/filter-data-tables-with-multi-select-comboboxes.md).
{% endhint %}

## Troubleshooting

<details>

<summary><strong>Allow Filtering is not in the column menu</strong></summary>

Either **Filterable** is already ticked in **All Columns Settings** (every column is filterable, so the per-column option is hidden), or, with a Query source, the field cannot be filtered in Salesforce (long text areas, for example).

</details>

## Related tutorials

* [Data Table editor](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/tips-and-tricks/data-table-editor.md): every option of the column menu.
* [How to create a combobox filtered data table](https://docs.avonnicomponents.com/flow/tutorials/reactive-query-tutorials/how-to-create-a-combobox-filtered-data-table.md): filter the query itself from a combobox on the same screen.


---

# 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/flow/tutorials/components/data-table/adding-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.
