> 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/move-a-deal-and-save-it-safely.md).

# Move a deal and save it safely

Let reps drag deals between stages on a Kanban, block a move that breaks a rule with a validation rule, and react to every saved move.

A rep drags a deal from **Value Proposition** to **Proposal/Price Quote** during the Monday pipeline review. The Kanban saves the new stage on the opportunity right away, with no Save button. If the deal has no amount yet, your sales process says it cannot reach the proposal stage: a validation rule refuses the save and the card goes back to its column.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fdwn3JZ5dRysXbeFqLTeK%2Fkanban-move-a-deal-and-save-it-safely-result.png?alt=media" alt="Opportunity Kanban columns under an Error Updating Record toast asking for an amount, the blank-amount deal still in its column"><figcaption><p>The validation rule refuses the move and the card returns to its column</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). This page adds to that board.
* Users who move cards need edit access to the opportunities and to the **Stage** field.
* Test in a running flow. In the property editor preview a drop saves nothing and runs no interaction.

## Steps

{% stepper %}
{% step %}

### Check that cards can move

Open the Kanban in the property editor. In the **Properties** tab, check that **Read Only** is off.

That is all the save needs. When a card lands in another column, the Kanban writes that column's value (here the Stage) to the record and shows a **Success** toast. You do not need an Update Records element, or an interaction, to save the move.
{% endstep %}

{% step %}

### Add the rule that refuses a move

The Kanban cannot veto a drop itself, and an **Item Drop** interaction runs only after the save. The gate is a validation rule on Opportunity.

In Setup, open **Object Manager** > **Opportunity** > **Validation Rules** and click **New**:

* **Rule Name**: `Amount_Required_From_Proposal`
* **Error Condition Formula**:

```
AND(
  ISBLANK(Amount),
  CASE(StageName,
    "Proposal/Price Quote", 1,
    "Negotiation/Review", 1,
    "Closed Won", 1,
    0) = 1
)
```

* **Error Message**: `Enter an amount before moving a deal to Proposal/Price Quote or later.`
* **Error Location**: **Top of Page**. With a field location, the toast only says "Errors concerning certain fields: Amount".

Save the rule. It also applies when someone edits the stage on the record page, a list view or an import.
{% endstep %}

{% step %}

### Try a refused move

Run the flow and drag a deal with no amount (its card shows `$0.00`) from **Value Proposition** to **Proposal/Price Quote**:

* an **Error Updating Record** toast shows your error message;
* the card returns to **Value Proposition**, and the column totals stay as they were;
* no **Item Drop** interaction runs (since version 6.34), so no confirmation toast or follow-up flow fires for a move that did not happen.

Drag a deal that has an amount: it stays in its new column and the **Success** toast appears.
{% endstep %}

{% step %}

### Refresh the board after each move

A saved stage can change other fields: Salesforce sets the default **Probability** of the new stage, and your own record-triggered flows may update more. To show those values on the card, re-read the records after each drop.

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

* **Type**: **Refresh Query**.
* **Components to refresh**: keep the current component.

**Refresh Query** is offered only when the **Data Source** is **Query**.
{% endstep %}

{% step %}

### Pick other follow-ups if you need them

Every **Item Drop** interaction runs after a successful save, in the order you add them.

| Type                 | Use it to                                                                                                                                                                                                                                                                                                                  |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Refresh Query**    | Re-read the records so the cards show values set by automation.                                                                                                                                                                                                                                                            |
| **Show Toast**       | Add your own message, for example a reminder to update the next step.                                                                                                                                                                                                                                                      |
| **Open Flow Panel**  | Open a flow in a panel on the board, for example to log the next step of the deal just moved. Pass the deal with an input variable `recordId` and the value `{{Record.Id}}`, as in [Open a flow from a card action](https://docs.avonnicomponents.com/flow/tutorials/components/kanban/open-a-flow-from-a-card-action.md). |
| **Flow Navigation**  | Go to the next screen, which can read the move from the **Dropped Item**, **Dropped Item Key Field** and **Dropped Item Group Value** outputs.                                                                                                                                                                             |
| **Update Record(s)** | Run **On Success** or **On Error** interactions after a second save of the record. Rarely needed: the Kanban already saved it. With it, the **Edited Records** outputs stay empty.                                                                                                                                         |

The **Edited Records** output collects the records moved on this screen. Use it to show a summary of the moves on the next screen. The moves are already saved.
{% endstep %}

{% step %}

### Save and test

Save and run the flow, then:

1. Drag a deal with no amount to **Proposal/Price Quote**. The error toast shows your message and the card goes back.
2. Add an amount to that deal on its record, then return to the flow and drag it again. The **Success** toast appears and the card stays.
3. If you added **Refresh Query**, check that the card and the column totals show the deal's new values.
   {% endstep %}
   {% endstepper %}

## Troubleshooting

<details>

<summary>The card goes back but the toast only says "Errors concerning certain fields"</summary>

The validation rule shows its message on a field. Edit the rule and set **Error Location** to **Top of Page**.

</details>

<details>

<summary>The card goes back even for deals that have an amount</summary>

Another rule or a required field refuses the save, or the user cannot edit **Stage**. Read the error toast: it carries the first error returned for the record.

</details>

<details>

<summary>A drop in the preview does nothing</summary>

Expected. The preview inside the property editor never saves a drop and runs no interaction. Run the flow to test.

</details>

<details>

<summary>My Item Drop toast does not show after a drop</summary>

The save failed, so the Kanban skipped the **Item Drop** interactions. Fix what the error toast reports, then drag again.

</details>

## Related tutorials

* [Build an opportunity pipeline board with column totals](https://docs.avonnicomponents.com/flow/tutorials/components/kanban/introduction.md): the board this page starts from.
* [Open a flow from a card action](https://docs.avonnicomponents.com/flow/tutorials/components/kanban/open-a-flow-from-a-card-action.md): act on a deal from its card instead of moving it.
* [Kanban](https://docs.avonnicomponents.com/flow/flow-components/kanban.md): every interaction type and output variable.
* [Refresh Query](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/refresh-query.md): the interaction reference.


---

# 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/move-a-deal-and-save-it-safely.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.
