> 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/configure-header-actions.md).

# Configure Header Actions

Header buttons above a pipeline table let a sales manager create a deal, or hand every selected deal to a new owner, without leaving the page.

A sales manager reviews the team's open pipeline. When a rep leaves, the manager ticks that rep's deals and hands them to someone else in one go. Header actions are the buttons above the table for that kind of work: they act on the whole table or on the rows the user selected.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FlrDnDQGk2S1bCKmOxYgk%2Fdata-table-tutorial-configure-header-actions-result.png?alt=media" alt="Pipeline table with New Opportunity and Reassign in the header and three rows selected"><figcaption><p>Header actions act on the whole table or on the selected rows.</p></figcaption></figure>

## Before you start

* A Data Table on the Opportunity object with a **Query** data source. See [Data Table](https://docs.avonnicomponents.com/dynamic-components/components/data-table.md).
* **Hide Checkbox Column** left off (**Properties** > **Content**), so users can select rows.
* For Reassign: an active Screen Flow with a record collection variable of type Opportunity, here `selectedOpportunities`, marked **Available for input**. The flow asks for the new owner and updates the records.

## Steps

{% stepper %}
{% step %}

### Add the header buttons

1. Select the Data Table and stay on the **Properties** tab.
2. In the **Header** section, open by default, add two items to **Actions**:

| Label           | Name              | Icon Name              |
| --------------- | ----------------- | ---------------------- |
| New Opportunity | `new_opportunity` | `utility:add`          |
| Reassign        | `reassign`        | `utility:change_owner` |

**Name** fills itself from the label. An action shows only when it has a **Name** and a **Label** or an **Icon Name**. **Title** sets the tooltip shown on hover.

Optional: turn on **Show Number of Items Selected** so the header counts the ticked rows, as in the figure above.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FVoB2057OFTXX8zEbAuRJ%2Fdata-table-tutorial-configure-header-actions-panel.png?alt=media" alt="Header section with the Actions list and Visible Actions Buttons set to 2" width="320"><figcaption><p>Two actions stay visible, the rest move into the menu.</p></figcaption></figure>
{% endstep %}

{% step %}

### Decide how many buttons stay visible

**Visible Actions Buttons** sets how many actions show as buttons. The others move into a menu at the end of the header. Set it to `2` here. With five or six actions, keep the two most used as buttons.

**Disable Actions** greys out every header action, and **Hide Actions** removes them.
{% endstep %}

{% step %}

### Wire New Opportunity

1. Open the **Interactions** tab and add an interaction under **Header Action Click**.
2. **Target Name**: **New Opportunity**. The list shows each action by its label.
3. **Type**: **Navigate**. **Page Reference Type**: **Object Page**. **Object Api Name**: Opportunity. **Action Name**: **New**.
   {% endstep %}

{% step %}

### Send the selected rows to the Reassign flow

1. Add a second interaction under **Header Action Click**, with **Target Name** **Reassign**.
2. **Type**: **Open Flow Dialog**. In **API Name**, pick the Reassign flow.
3. Under **Input Variables**, add an item:
   * **Name**: `selectedOpportunities`.
   * **Value**: the Data Table's **Selected Rows sObject** output, which holds every row the user ticked as a full record.
   * **Type**: **Salesforce Object**, with **Object API Name** `Opportunity`.
   * **Allow Multiple Values**: on, since the flow receives a collection.
4. Under **On Finish**, add **Refresh Query** so the new owners show at once.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FLiImT2J2DS9DqBPdaN7D%2Fdata-table-tutorial-configure-header-actions-interaction.png?alt=media" alt="Header Action Click interaction passing the selected rows to a flow" width="320"><figcaption><p>The selected rows reach the flow as a collection of records.</p></figcaption></figure>
{% endstep %}

{% step %}

### Save and test

Save the component and open the page where it is placed. The header shows **New Opportunity** and **Reassign**. Tick three deals and click **Reassign**: the flow receives those three records. After **Finish**, the table reloads and the three deals show their new owner.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Need only the record Ids, for a flow with a Text collection variable? Map the Data Table's `selectedRowsKeyValue` output instead. See [How to Pass Multiple Selected Records from a Dynamic Component to a Screen Flow](https://docs.avonnicomponents.com/dynamic-components/tutorials/interactions/flow-integration/how-to-pass-multiple-selected-records-from-a-dynamic-component-to-a-screen-flow.md).
{% endhint %}

## Troubleshooting

<details>

<summary>The button does not appear in the header</summary>

Check that the action has a **Name**, and a **Label** or an **Icon Name**. Also check that **Hide Actions** is off in the **Header** section.

</details>

<details>

<summary>The flow receives an empty collection</summary>

**Selected Rows sObject** holds only the rows ticked before the click. Users who click without ticking anything send an empty list. Make the flow handle that case with a message, or add a Decision at its start.

</details>

## Related tutorials

* [Enable Data Export](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/enable-data-export.md): an Export header button, the most common header action.
* [Add Custom Buttons](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/add-custom-buttons.md): a button on each row instead of above the table.
* [Define Row Actions](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/define-row-actions.md): a menu of actions on each row.


---

# 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/configure-header-actions.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.
