> 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/tips-and-tricks/how-to-grayscale-header-actions-dynamically-in-avonni-data-table.md).

# How to Grayscale Header Actions Dynamically in Avonni Data Table

Keep the Data Table header buttons grayed out until the user ticks at least one row, with a Boolean formula bound to Disable Actions.

A **Reassign** button in the table header makes no sense while nothing is ticked. Clicking it opens a second flow with an empty list. Gray the header actions out until the user selects at least one row: a formula counts the selected rows and drives the table's **Disable Actions** setting.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FeaGrzNYaGihE1oqeb0pa%2Fdata-table-tutorial-how-to-grayscale-header-actions-dynamically-in-avonni-data-table-result.png?alt=media" alt="Data Table with its header buttons grayed out because no row is selected"><figcaption><p>No row ticked, so the header actions stay disabled.</p></figcaption></figure>

## Before you start

* A Data Table with at least one header action. [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) builds a **Reassign** action.
* The API name of the Data Table on the screen, shown in the screen's properties when you select the component. This page uses `DealsTable`.

## Steps

{% stepper %}
{% step %}

### Create the formula

In Flow Builder, open the **Toolbox**, click **New Resource** and set:

* **Resource Type**: **Formula**
* **API Name**: `NoRowsSelected`
* **Data Type**: **Boolean**
* **Formula**:

```
BLANKVALUE({!DealsTable.nbSelectedRows}, 0) = 0
```

`nbSelectedRows` is the Data Table output **Number of Selected Rows**. The formula returns `true` while no row is ticked, which is when the actions must be disabled. `BLANKVALUE` treats an empty count as zero. Replace `DealsTable` with your Data Table's API name.
{% endstep %}

{% step %}

### Bind the formula to Disable Actions

1. Select the Data Table and click **Open Component Builder**.
2. In the **Properties** tab, open the **Header** group.
3. Next to **Disable Actions**, open the resource picker and select the formula. The picker shows `NoRowsSelected` as **No Rows Selected**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FNzLuHi7YTH2tCqAV4Epv%2Fdata-table-tutorial-how-to-grayscale-header-actions-dynamically-in-avonni-data-table-panel.png?alt=media" alt="Header group of the Properties tab with Disable Actions bound to the NoRowsSelected formula" width="320"><figcaption><p>Disable Actions reads the formula, for all header actions at once.</p></figcaption></figure>

{% hint style="warning" %}
Use **Disable Actions** in the **Header** group. It applies to every header action at once. The **Disabled** checkbox inside each item of **Actions** is a separate, per-button setting.
{% endhint %}
{% endstep %}

{% step %}

### Save and test

Click **Done**, save the flow and run it. The header buttons show grayed out when the screen opens. Tick one row: they turn active. Untick it: they gray out again.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>The buttons stay enabled when nothing is selected</summary>

Check the formula direction. It must return `true` when the count is `0`, because the setting disables the actions. A formula that returns `true` when rows are ticked does the opposite.

</details>

## Related tutorials

* [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): the header action this page protects.
* [Work with Selected Rows](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/work-with-selected-rows.md): cap the selection and read it in later elements.
* [Enabling auto-refresh on the Data Table when pressing a button](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/tips-and-tricks/enabling-auto-refresh-on-the-data-table-when-pressing-a-button.md): another header action, the Refresh button.


---

# 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/tips-and-tricks/how-to-grayscale-header-actions-dynamically-in-avonni-data-table.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.
