> 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/tree-grid/add-row-and-header-actions.md).

# Add row and header actions

Add a row menu and a header button to a screen flow Tree Grid, then log a call, open a record or hand the clicked account to the rest of the flow.

An account manager reviews a customer group in a screen flow. Each subsidiary gets a small menu: Log a Call opens a short flow on that account, View Account opens its record, and Escalate moves the flow on with the account she picked. Above the grid, a Plan Review button sends every account she ticked to a review flow.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fju7xCinSu7yvdCKVKACk%2Ftree-grid-add-row-and-header-actions-result.png?alt=media" alt="Tree Grid of a customer group with the row menu open on Meridian UK showing Log a Call, View Account and Escalate, and a Plan Review button in the header"><figcaption><p>A row menu on every account and one header button for the ticked rows.</p></figcaption></figure>

## Before you start

* A screen flow with a Tree Grid on the customer group's accounts, using the **Query** data source. [Show an account hierarchy](https://docs.avonnicomponents.com/flow/tutorials/components/tree-grid/show-an-account-hierarchy.md) sets it up. **Refresh Query** and the record operations are only offered with **Query**.
* An active screen flow `Log_a_Call` with a Text variable `recordId`, **Available for input** checked, that creates a Task on that account.
* An active screen flow `Plan_Account_Review` with a Text collection variable `accountIds`, **Available for input** checked.
* The examples use the API Name `AccountTree` for the Tree Grid.

## Steps

{% stepper %}
{% step %}

### Add an Action column

1. Select the Tree Grid and click **Open Component Builder**.
2. In the **Properties** tab, under **Data Mappings** > **Columns**, add a column and choose **Custom** instead of **Object Field**.
3. Set **Name** to `actions` and **Type** to **Action**.

The column has no field behind it. It holds the menu, on every row of the tree.
{% endstep %}

{% step %}

### List the actions of the menu

In the column's **Type Attributes**, under **Row Actions**, add one entry per menu item:

* **Label**: what the user reads, `Log a Call`.
* **Name**: what the interactions and the flow use. It fills in from the Label and rejects special characters. Set it to `log_call`.
* **Disabled** and **Hidden** are optional, per entry.

Add `View Account` (`view_account`) and `Escalate` (`escalate`) the same way. **Menu Alignment** sets where the menu opens.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FuAsXc4wmxeR5YUCVi3y3%2Ftree-grid-add-row-and-header-actions-type-attributes.png?alt=media" alt="Column settings with Type set to Action and three row actions listed under Row Actions" width="320"><figcaption><p>The Action column and its three row actions.</p></figcaption></figure>
{% endstep %}

{% step %}

### Log a call from the row

1. Go to the **Interactions** tab and add a **Row Action Click** interaction.
2. In **Target Name**, pick **Log a Call**. The list shows every row action by its label.
3. Set **Type** to **Open Flow Dialog** and pick **Log a Call** in **API Name** (the list shows flow labels). **Modal Header** sets the dialog title.
4. Under **Input Variables**, add an item: **Name** `recordId`, **Value** **Record: Id** (the Id of the row the user clicked), **Type** **Text**.
5. Under **On Finish**, add **Refresh Query** so the grid reloads when the dialog closes.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F757TwJ9R22LgE5hwg5wO%2Ftree-grid-add-row-and-header-actions-interaction.png?alt=media" alt="Row Action Click interaction opening the Log a Call flow with the row&#x27;s Id and a Refresh Query on finish" width="320"><figcaption><p>Log a Call opens a flow on the clicked account, then reloads the grid.</p></figcaption></figure>
{% endstep %}

{% step %}

### Open the record

Add a second **Row Action Click**, **Target Name** **View Account**:

* **Type**: **Navigate**, then **Page Reference Type**: **Record Page**.
* **Object Api Name**: `Account`. **Record Id**: the row's Id. **Action Name**: **View**.

{% hint style="warning" %}
**Navigate** on a row action has no window setting, so the record page opens in place of the flow. To keep the user in the flow, do the record work in a dialog with **Open Flow Dialog** instead.
{% endhint %}
{% endstep %}

{% step %}

### Hand the clicked account to the flow

Some changes belong in the flow, with your own checks. For **Escalate**:

1. Add a third **Row Action Click**, **Target Name** **Escalate**, **Type** **Flow Navigation**, then **Next Screen**.
2. After the screen, add a **Decision**: `{!AccountTree.clickedRowActionName}` **Equals** `escalate`.
3. On that path, a **Create Records** on Task: **Related To ID** (`WhatId`) = `{!AccountTree.clickedRowActionKeyValue}`, **Subject** = a Text formula `"Escalation review: " & {!AccountTree.clickedRowActionRow.Name}`.
4. Connect the path back to the Tree Grid screen.

The three row outputs are filled on every row click:

| Output variable                        | Reference                                 | What it returns                          |
| -------------------------------------- | ----------------------------------------- | ---------------------------------------- |
| **Clicked Row Action Name**            | `{!AccountTree.clickedRowActionName}`     | The **Name** of the action, `escalate`   |
| **Clicked Row Action Key Field Value** | `{!AccountTree.clickedRowActionKeyValue}` | The Id of the clicked row                |
| **Clicked Row Action Row**             | `{!AccountTree.clickedRowActionRow}`      | The clicked record, for its other fields |

One Decision can route several actions this way.
{% endstep %}

{% step %}

### Add a header button for the ticked accounts

1. In the **Properties** tab, open the **Header** group. Under **Actions**, add an item: **Label** `Plan Review`, **Name** `plan_review`, **Icon Name** `utility:event`.
2. In the **Interactions** tab, add a **Header Action Click** interaction, **Target Name** **Plan Review**, **Type** **Open Flow Dialog**, **API Name** **Plan Account Review**.
3. Under **Input Variables**: **Name** `accountIds`, **Value** **Selected Row Key Values**, **Type** **Text**, with **Allow Multiple Values (collection)** on.

**Selected Row Key Values** carries the Ids of the ticked rows. If the button sends the flow to the next screen instead (**Flow Navigation**), read **Clicked Header Action Name** (`{!AccountTree.clickedHeaderActionName}`) after the screen to know which button was clicked.
{% endstep %}

{% step %}

### Save and test

Click **Done**, save the flow and run it with **Debug**. Every row ends with a menu button. **Log a Call** opens the dialog on that account, and the grid reloads when it closes. **View Account** opens the record page. **Escalate** moves to the next screen, the Decision takes the `escalate` path and the Task appears on the account. Tick two accounts and click **Plan Review**: the review flow opens with those two Ids.
{% endstep %}
{% endstepper %}

## What a row action can run

Each **Row Action Click** or **Header Action Click** runs one **Type**. The most useful ones:

| Type                                                                                                                                                                                                                                            | What happens                                                                  | Data source |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------- |
| [**Open Flow Dialog**](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/open-flow-dialog.md) / [**Open Flow Panel**](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/open-flow-panel.md) | Runs another screen flow in a modal or a side panel                           | Any         |
| [**Navigate**](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/navigate.md)                                                                                                                                         | Opens a record page, an object page or a URL. A record page replaces the flow | Any         |
| [**Flow Navigation**](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/flow-navigation.md)                                                                                                                           | Moves the flow to the next screen, back, pause or finish                      | Any         |
| **Show Toast**, **Open Alert Modal**, **Open Confirm Dialog**                                                                                                                                                                                   | Shows a message, an alert or a confirmation                                   | Any         |
| **Edit Selected Record(s)**, **Delete Selected Record(s)**, **Duplicate Selected Record(s)**                                                                                                                                                    | Edits, deletes or copies the record                                           | Query       |
| [**Refresh Query**](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/refresh-query.md)                                                                                                                               | Reloads the grid                                                              | Query       |

## Troubleshooting

<details>

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

**Target Name** lists the **Row Actions** entries that have a **Name**. A **Button** or **Button Icon** column is a target too, listed by its own **Name**, which stays empty until you fill it.

</details>

<details>

<summary>Edit, Delete or Refresh Query is not in the list of types</summary>

Those types need the **Query** data source. With **Manual**, the rows have no Salesforce record behind them.

</details>

<details>

<summary>The second flow opens but receives no account</summary>

Check that its input variable is marked **Available for input**, that its data type matches the **Type** of the interaction item (**Text** for an Id, a Text collection for **Selected Row Key Values**), and that **Value** is a **Record:** entry for a row action.

</details>

<details>

<summary>The user lands on the record page and the flow is gone</summary>

**Navigate** on a row action replaces the flow. Use **Open Flow Dialog** or **Flow Navigation** when the user must stay in the flow.

</details>

## Related tutorials

* [Work with selected rows](https://docs.avonnicomponents.com/flow/tutorials/components/tree-grid/work-with-selected-rows.md): update the ticked accounts after **Next** instead of from a button.
* [Show an account hierarchy](https://docs.avonnicomponents.com/flow/tutorials/components/tree-grid/show-an-account-hierarchy.md): the grid these actions sit on.
* [How to create an interaction to open another flow](https://docs.avonnicomponents.com/flow/tutorials/interactions/how-to-create-an-interaction-to-open-another-flow.md): the **Open Flow Dialog** settings in detail.
* [Tree Grid](https://docs.avonnicomponents.com/flow/flow-components/tree-grid.md): every interaction and output variable.


---

# 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/tree-grid/add-row-and-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.
