> 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/column-header-actions-and-default-filters.md).

# Column Header Actions and Default Filters

Open a screen flow Data Table already filtered on the deals that matter, and add your own entry to a column header menu that the flow can act on.

Before the forecast call, a sales manager wants the deals table to open on **Negotiation/Review** only, not on the whole pipeline. She also wants to push slipping deals to next quarter straight from the **Close Date** column. A default filter value handles the first part: it applies when the table loads. A column header action handles the second: a custom entry in the column's header menu that the flow reacts to. The click changes nothing by itself, the flow decides what it acts on. Here it moves the deals the user ticked, and the column only says where the entry lives. When the column does not matter, a header button above the table is simpler.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FyuMv4FRtJRVz9b9mGJnK%2Fdata-table-tutorial-column-header-actions-and-default-filters-result.png?alt=media" alt="Deals table opened filtered on Negotiation/Review, two deals ticked, the Close date header menu open on Push to Next Quarter"><figcaption><p>A default filter value and a custom entry in the Close Date header menu.</p></figcaption></figure>

## Before you start

* A screen with an Avonni Data Table on Opportunity, fed by a **Query** or a **Variable** (Get Records) data source, with the columns Opportunity Name, Stage, Amount and Close Date. [Learn the Basics](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/learn-the-basics.md) sets one up. The examples use the API Name `DealsTable`.
* Filters in general (where they show, the filter panel) are covered in [Adding filters](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/adding-filters.md). This page only adds the default value.

## Open the table already filtered

{% stepper %}
{% step %}

### Add a Stage filter

1. Select the Data Table on the screen and click **Open Component Builder**.
2. In the **Properties** tab, under **Data Mappings**, open **Filters** and add an entry.
3. Set **Filter By** to **Stage**.

Each field can be listed once, and it does not need to be a visible column.
{% endstep %}

{% step %}

### Give it a default value

In the same entry, set **Default Value (Optional)**. The input follows the field's type:

| Field type                      | What you enter                                                    |
| ------------------------------- | ----------------------------------------------------------------- |
| Picklist                        | One or more values of the field, for example `Negotiation/Review` |
| Text, lookup, Id                | A list of values                                                  |
| Number, currency, percent, date | One value, which fills both ends of the range                     |
| Checkbox                        | **True** or **False**                                             |

For the forecast view, pick `Negotiation/Review`. To show the filter under your own name, open **Advanced Options**, turn on **Custom Label** and type the **Label**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fd6jLvXHR0UIOv0swDt77%2Fdata-table-tutorial-column-header-actions-and-default-filters-filter-default.png?alt=media" alt="Filters entry with Filter By set to Stage and Default Value (Optional) set to Negotiation/Review" width="320"><figcaption><p>The default value applies when the table loads.</p></figcaption></figure>
{% endstep %}

{% step %}

### Save and test

Click **Done**, save the flow and run it with **Debug**. The table opens with only the Negotiation/Review deals, and the Stage filter shows that value as selected. The user can change it or clear it like any other filter, and the full pipeline comes back.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Default Value (Optional)** is a fixed value: it cannot come from a flow variable. When the starting filter depends on the context (the current account, the running user), filter the data source instead, in the Query conditions or the Get Records, and keep the default value for the view everybody shares.
{% endhint %}

## Add a column header action

{% stepper %}
{% step %}

### Add the action to the column

1. In **Data Mappings** > **Columns**, open the **Close Date** column.
2. Under **Actions**, add an entry:
   * **Label**: `Push to Next Quarter`
   * **Name**: `push_next_quarter`. This is the value the flow receives.
   * **Icon Name**: `utility:forward` (optional)
3. **Checked** draws a check mark beside the entry, for an action that reads as an on or off option. **Disabled** grays it out.

The entry appears in the Close Date header menu.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F9h7IbBqxiMGmC1VHy2XG%2Fdata-table-tutorial-column-header-actions-and-default-filters-column-actions.png?alt=media" alt="Actions of the Close Date column with the Push to Next Quarter entry" width="320"><figcaption><p>A column action needs a Label and a Name.</p></figcaption></figure>
{% endstep %}

{% step %}

### Wire the click

1. Open the **Interactions** tab and add an interaction under **Column Header Action Click**.
2. In **Target Name**, pick **Push to Next Quarter**. The list holds the actions of every column.
3. Set **Type** to **Flow Navigation**, then the second **Type** to **Next Screen**.

Other types work too: an **Open Flow Dialog** keeps the user on the screen, as in [Passing multiple record IDs to another flow](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/tips-and-tricks/passing-multiple-record-ids-to-another-flow.md).
{% endstep %}

{% step %}

### Branch on the action after the screen

The click fills two outputs of `DealsTable`:

* **Clicked Column Header Action Name**: the **Name** of the action, here `push_next_quarter`.
* **Clicked Column Header Action Column Field Name**: the API name of the column it came from, here `CloseDate`.

1. Add a **Decision** with an outcome where `{!DealsTable.clickedColumnHeaderActionName}` **Equals** `push_next_quarter`.
2. On that path, a **Loop** over `{!DealsTable.selectedRows}`, named `Loop_Deals`.
3. Inside the loop, an **Assignment** sets `{!Loop_Deals.CloseDate}` to a formula resource `ADDMONTHS({!Loop_Deals.CloseDate}, 3)` and adds the loop variable to a collection `DealsToUpdate`.
4. After the loop, one **Update Records** on `DealsToUpdate`.

[Work with Selected Rows](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/work-with-selected-rows.md) details the Loop pattern.
{% endstep %}

{% step %}

### Save and test

Run the flow, tick two deals, and open the **Close Date** header menu: **Push to Next Quarter** is listed with its icon. Click it. The flow moves on, takes the Decision outcome, and the two deals now close three months later.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
Give the same **Name** to an action on several columns (for example `explain_column` on Amount and Close Date) and wire one interaction. **Clicked Column Header Action Column Field Name** then tells the flow which column the user asked about.
{% endhint %}

## Troubleshooting

<details>

<summary>The action is missing from Target Name</summary>

**Target Name** lists the column actions that have a **Name**. Open the column's **Actions** entry and check that **Name** is filled.

</details>

<details>

<summary>The Decision never takes the outcome</summary>

The outcome compares the **Name**, not the **Label**. Compare `{!DealsTable.clickedColumnHeaderActionName}` with `push_next_quarter`, spelled exactly as in the action.

</details>

## Related tutorials

* [Adding filters](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/adding-filters.md): where filters show and how users apply them.
* [Work with Selected Rows](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/work-with-selected-rows.md): the selection the column action works on.
* [Creating Row Actions](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/creating-row-actions.md): actions on one row instead of a column.


---

# 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/column-header-actions-and-default-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.
