> 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/list/act-on-a-row.md).

# Act on a Row

Put Log a Call and Mark as Lost buttons on each deal of a List, a New Opportunity button in its header, and route the Screen Flow on the one clicked.

During the pipeline review, the sales manager wants to act on a deal without leaving the screen: log a call on one, mark another as lost, or start a new opportunity. Each deal in the List gets its own buttons, the header gets one more, and a **Decision** element after the screen sends the flow down the right path for the button clicked.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fvowrm70MVH2BSaIJFXby%2Flist-act-on-a-row-result.png?alt=media" alt="A deal list with Log a Call and Mark as Lost buttons on each deal, an open menu showing Edit, and a New Opportunity button in the header" width="480"><figcaption><p>Two actions show as buttons and the third waits in the menu</p></figcaption></figure>

## Before you start

* A List on a flow screen fed by a **Get Records** collection. [Show Dates, Times and Links](https://docs.avonnicomponents.com/flow/tutorials/components/list/show-dates-times-and-links.md) builds the one used here: `Get_Open_Deals` (open Opportunities) shown in `PipelineList`.
* For a List built on a **Query** that opens records with a **Navigate** interaction, without a Decision, see [Vertical List with Actions](https://docs.avonnicomponents.com/flow/tutorials/components/list/vertical-list-with-actions.md).

## Steps

{% stepper %}
{% step %}

### Add the item actions

1. In the **Properties** tab, open the **Actions** group and add three **Item Actions**:

| Label        | Name        | Icon Name       |
| ------------ | ----------- | --------------- |
| Log a Call   | `log_call`  | `utility:call`  |
| Mark as Lost | `mark_lost` | `utility:close` |
| Edit         | `edit`      | `utility:edit`  |

2. Set **Visible Item Actions** to `2`. The first two show as buttons on each deal, **Edit** moves to a menu.

The flow reads the **Name**, never the **Label**, so keep names short and stable.
{% endstep %}

{% step %}

### Add a header action

1. In the **Header** group, add an entry under **Actions**: **Label** `New Opportunity`, **Name** `new_opportunity`, **Icon Name** `utility:add`.
2. **Visible Actions Buttons** sets how many header actions show as buttons before the rest fold into a menu.
   {% endstep %}

{% step %}

### Leave the screen when a button is clicked

A click fills the List's output variables. To move on without an extra click on **Next**, give each action a **Flow Navigation** interaction.

1. Open the **Interactions** tab and add an **Item Action Click** interaction.
2. **Target Name**: pick **Log a Call**. The picker lists actions by label and stores the name, `log_call`. **Type**: **Flow Navigation**, then **Next Screen** in the second **Type** field.
3. Repeat for **Mark as Lost** and **Edit**.
4. Add a **Header Action** interaction with **Target Name** set to the **New Opportunity** action, set the same way.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fo8AFPpxzS6TmD6TWUlWl%2Flist-act-on-a-row-interaction.png?alt=media" alt="The Interactions tab with an Item Action Click interaction targeting log_call and set to Flow Navigation, Next Screen" width="480"><figcaption><p>Each action moves the flow to the next element as soon as it is clicked</p></figcaption></figure>
{% endstep %}

{% step %}

### Route the flow with a Decision

After the screen, add a **Decision** element `Route_Action` with one outcome per action:

| Outcome           | Condition                                                              |
| ----------------- | ---------------------------------------------------------------------- |
| `Log_Call`        | `{!PipelineList.clickedItemActionName}` **Equals** `log_call`          |
| `Mark_Lost`       | `{!PipelineList.clickedItemActionName}` **Equals** `mark_lost`         |
| `Edit_Deal`       | `{!PipelineList.clickedItemActionName}` **Equals** `edit`              |
| `New_Opportunity` | `{!PipelineList.clickedHeaderActionName}` **Equals** `new_opportunity` |

In the resource picker these appear under `PipelineList` as **Clicked Item Action Name** and **Clicked Header Action Name**.
{% endstep %}

{% step %}

### Use the clicked deal in each branch

**Clicked Item Action Item** is the Opportunity the action was clicked on, with every field `Get_Open_Deals` stored.

* `Mark_Lost`: an **Update Records** element, **Specify conditions to identify records, and set fields individually**, **Object** Opportunity, condition `Id` **Equals** `{!PipelineList.clickedItemActionItem.Id}`, and set `StageName` to `Closed Lost`.
* `Log_Call`: a screen with a text area for the notes, then a **Create Records** element for a Task with `WhatId` set to `{!PipelineList.clickedItemActionItem.Id}` and `Status` set to `Completed`.
* `Edit_Deal`: a screen holding the deal's fields, followed by an **Update Records** element.

Connect each branch back to `Get_Open_Deals`, so the manager returns to a refreshed list.
{% endstep %}

{% step %}

### Save and test

1. Save the flow and click **Debug**.
2. Click **Mark as Lost** on a deal. The flow skips **Next**, goes down `Mark_Lost`, and returns to the list without that deal.
3. Open the menu on a deal and click **Edit**: the edit screen opens for that deal.
4. Click **New Opportunity** in the header: the flow takes the `New_Opportunity` path.
   {% endstep %}
   {% endstepper %}

## Actions on an item's image

When the items show an image (an **Image Source** mapping), the **Actions** group also takes **Media Actions**, drawn on the image. **Visible Media Actions** caps how many show. They work like item actions: a **Media Action Click** interaction with a **Target Name**, then the outputs **Clicked Item Media Action Name** and **Clicked Item Media Action Item** in the Decision.

{% hint style="info" %}
**Simple actions can skip the Decision.** An **Item Action Click** interaction can open the record (**Navigate**), a quick action (**Open Quick Action**) or another flow (**Open Flow Dialog**) on its own. The [Interactions Panel](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel.md) lists every type.
{% endhint %}

## Troubleshooting

<details>

<summary>The Decision always takes the default outcome</summary>

The condition compares with the action's **Label** (`Log a Call`) instead of its **Name** (`log_call`). Or the outcome reads **Clicked Item Action Name** for a header button, which fills **Clicked Header Action Name** instead.

</details>

<details>

<summary>The user has to click Next after the action</summary>

The **Item Action Click** interaction is missing for that action, or its **Target Name** points at another action. Without **Flow Navigation**, the click only fills the outputs.

</details>

<details>

<summary>A field of Clicked Item Action Item is empty</summary>

The record comes from the collection the List shows, so it only carries the fields `Get_Open_Deals` stored. Set that element to **Automatically store all fields**, or add the missing field to the ones it stores.

</details>

<details>

<summary>An Item Click with Navigate does nothing when the flow runs in an Open Flow Dialog</summary>

Inside a flow launched by **Open Flow Dialog**, a **Navigate** interaction on **Item Click** does not open the record. Map **URL** to `/lightning/r/Opportunity/{{Record.Id}}/view` in **Data Mappings** instead, as shown in [Show Dates, Times and Links](https://docs.avonnicomponents.com/flow/tutorials/components/list/show-dates-times-and-links.md).

</details>

## Related tutorials

* [Vertical List with Actions](https://docs.avonnicomponents.com/flow/tutorials/components/list/vertical-list-with-actions.md): item actions on a Contact list, wired to interactions only.
* [Search, Filter and Paginate a List](https://docs.avonnicomponents.com/flow/tutorials/components/list/search-filter-and-paginate.md): help users find the deal before they act on it.
* [Build a Checklist That Saves](https://docs.avonnicomponents.com/flow/tutorials/components/list/build-a-checklist-that-saves.md): another way to send the user's choices from a List to the flow.


---

# 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/list/act-on-a-row.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.
