> 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/kanban/open-a-flow-from-a-card-action.md).

# Open a flow from a card action

Add Reassign and Edit actions to every opportunity card, open a flow in a side panel for the clicked deal, and add a New Deal button above the board.

A sales manager spots a deal whose owner is out for a month. Instead of leaving the board to open the record, she clicks **Reassign** in the card's menu: a panel opens on the board with that deal and a field to pick the new owner. When she finishes, the card shows the new owner. The same pattern runs any flow on the clicked record.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F6SjJEgEZw14vfMoTFXYs%2Fkanban-open-a-flow-from-a-card-action-result.png?alt=media" alt="Opportunity Kanban with a side panel titled Reassign deal showing the clicked deal and a New owner field"><figcaption><p>Reassign opens a panel flow for the clicked deal</p></figcaption></figure>

## Before you start

* Build the pipeline board first: [Build an opportunity pipeline board with column totals](https://docs.avonnicomponents.com/flow/tutorials/components/kanban/introduction.md). Its cards show the owner name, which makes the reassignment visible.
* The board uses the **Query** data source, so it can refresh itself after the panel flow finishes.

## Steps

{% stepper %}
{% step %}

### Build the flow that opens in the panel

Create a screen flow labelled `Reassign deal`:

* A Text variable `recordId`, with **Available for input** checked.
* A **Get Records** element on Opportunity where `Id` Equals `{!recordId}`.
* A screen that shows the deal name and a **Lookup** component on Opportunity, field `OwnerId`, labelled `New owner`.
* An **Update Records** element on Opportunity where `Id` Equals `{!recordId}`, setting `OwnerId` to the record Id picked in the lookup.

Save and activate it.
{% endstep %}

{% step %}

### Add the card actions

Back in the board's flow, open the Kanban in the property editor. In the **Properties** tab, open **Card Actions** and add two items under **Actions**:

| **Label**  | **Name**   |
| ---------- | ---------- |
| `Reassign` | `reassign` |
| `Edit`     | `edit`     |

The actions appear in the menu at the top right of every card. **Disabled** and **Hidden** turn an action off without deleting it.
{% endstep %}

{% step %}

### Open the panel flow on Reassign

In the **Interactions** tab, under **Item Action Click**, add an interaction:

* **Target Name**: the `reassign` action. Target Name is a filter: this interaction runs only for that action. Left empty, it would run for every card action.
* **Type**: **Open Flow Panel**.
* **API Name**: `Reassign deal`. The list shows flows by their label.
* **Header**: `Reassign deal`.

Under **Input Variables**, click **Add Item**:

* **Name**: `recordId`. The list shows the input variables of the panel flow. Click the edit icon on the row to set its value and type.
* **Value**: the Id of the card that was clicked. Pick the record's Id field under **Record:** in the list, which writes `{{Record.Id}}`.
* **Type**: **Text**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FIhc4JcEVsGAiINb35tXN%2Fkanban-open-a-flow-from-a-card-action-open-flow-panel.png?alt=media" alt="Item Action Click interaction with Target Name Reassign, Open Flow Panel, and a recordId input variable" width="320"><figcaption><p>Target Name picks the action, Input Variables pass the card's record Id</p></figcaption></figure>
{% endstep %}

{% step %}

### Refresh the board when the flow finishes

Still in that interaction, under **On Finish**, add **Refresh Query** and keep the current component. When the manager finishes the panel flow, the board re-reads the opportunities and the card shows its new owner.

With **Open Flow Panel** in place, the **Style** tab gains **Flow Panel** and **Flow Panel Header** settings for the panel's look.
{% endstep %}

{% step %}

### Edit a deal without writing a flow

Add a second **Item Action Click** interaction:

* **Target Name**: the `edit` action.
* **Type**: **Edit Selected Record(s)**.

A click on **Edit** opens an **Edit Record** dialog with the opportunity's full page layout. After a save, the board refreshes on its own.
{% endstep %}

{% step %}

### Add a New Deal button above the board

A header action sits above the board and belongs to no card.

1. In the **Properties** tab, open **Header** and add an item under **Actions**: **Label** `New Deal`, **Name** `new_deal`.
2. Set **Visible Actions Buttons** to `1`, so the action shows as a button instead of sitting in a menu.
3. In the **Interactions** tab, under **Header Action**, add an interaction: **Target Name** the `new_deal` action, **Type** **Open Flow Panel**, **API Name** your new opportunity flow, and **Refresh Query** under **On Finish**.

Because no card is behind it, a header action's values cannot read a record.
{% endstep %}

{% step %}

### Save and test

Save and run the board's flow, then:

1. Open the menu of a card and click **Reassign**. A panel opens on the board with that deal.
2. Pick a new owner and click **Next**. The panel closes and the card shows the new owner.
3. Click **Edit** on another card. The **Edit Record** dialog opens on that deal.
4. Click **New Deal** above the board. Your new opportunity flow opens in the panel.
   {% endstep %}
   {% endstepper %}

The flow can also branch after the screen instead of opening a panel: the **Clicked Item Action Name** output returns the **Name** of the clicked action (`reassign`, `edit`) and **Clicked Item Action Item** its record. A **Decision** element can route on them.

## Troubleshooting

<details>

<summary>The Name list under Input Variables is empty</summary>

The panel flow has no input variable. Open `Reassign deal`, check **Available for input** on `recordId`, save and activate, then reopen the interaction.

</details>

<details>

<summary>Reassign also runs when I click Edit</summary>

The Reassign interaction has no **Target Name**, so it runs for every action. Set **Target Name** to the `reassign` action.

</details>

<details>

<summary>The card still shows the old owner after the panel closes</summary>

Add **Refresh Query** under **On Finish** of the **Open Flow Panel** interaction. If **Refresh Query** is not offered, the board uses the **Variable** data source: switch it to **Query**.

</details>

<details>

<summary>Clicking an action in the preview does nothing</summary>

Expected. Card and header actions do not run their interactions in the property editor preview. Run the flow to test.

</details>

## Related tutorials

* [Move a deal and save it safely](https://docs.avonnicomponents.com/flow/tutorials/components/kanban/move-a-deal-and-save-it-safely.md): what happens when a rep drags a card instead.
* [How to setup an Open Flow Panel interaction](https://docs.avonnicomponents.com/flow/tutorials/interactions/how-to-setup-an-open-flow-panel-interaction.md): every panel option, including position, size and output variables.
* [Kanban](https://docs.avonnicomponents.com/flow/flow-components/kanban.md): every interaction type and output variable of the component.


---

# 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/kanban/open-a-flow-from-a-card-action.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.
