> 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/record-grid/edit-and-save-values-in-a-record-grid.md).

# Edit and Save Values in a Record Grid

Let a sales manager correct Amount, Close Date and Stage directly in a Record Grid and save the changes to Salesforce without leaving the screen.

A sales manager compares three open opportunities of one account before she approves a discount. With the deals side by side, she sees a close date that slipped and an amount that no longer matches the quote. An editable Record Grid lets her fix both in place and click **Save** to update the opportunities.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FvUHcQjsBsFLfSVVRSaSb%2Frecord-grid-edit-and-save-values-in-a-record-grid-result.png?alt=media" alt="A Record Grid with three opportunities as columns, editable Amount, Close Date and Stage cells shown as inputs, one changed Amount highlighted in yellow, and a Cancel and Save footer below the grid"><figcaption><p>A changed value turns yellow and the Cancel and Save footer appears until the user saves.</p></figcaption></figure>

## Before you start

* A screen flow with a Record Grid in **Variable** mode that shows Opportunity records, with the opportunity name as **Column Header Field** and Amount, Close Date, Stage and Probability as **Row Fields**. [Compare records side by side with Record Grid](https://docs.avonnicomponents.com/flow/tutorials/components/record-grid/compare-records-side-by-side-with-record-grid.md) builds it.
* Users who run the flow need edit access to Opportunity and to each field they will change. The grid checks this for the running user and keeps a row read-only when that user cannot edit the field.

## Steps

{% stepper %}
{% step %}

### Mark the rows users can change

On the **Properties** tab, under **Row Fields**, open the Amount entry and turn on **Editable**. Do the same for Close Date and Stage. Leave Probability as it is, so the manager can read it but not change it.

* Stage opens as a picklist of the field's own values.
* A row stays read-only even with **Editable** on when the field is not editable for the running user (a formula field, for example) or comes from a related record (such as `Account.Name`). A Date Time row also stays read-only; a Date row can be edited.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FMRJ5zkHUQc1jAJGPFlgl%2Frecord-grid-edit-and-save-values-in-a-record-grid-row-fields.png?alt=media" alt="The Row Fields entry for Amount in the Record Grid property editor, with Field set to Amount, Type set to Currency and the Editable toggle turned on" width="320"><figcaption><p>Editable is set per row, in each Row Fields entry.</p></figcaption></figure>
{% endstep %}

{% step %}

### Leave Read Only off

**Read Only**, at the top of the **Properties** tab, overrides every **Editable** entry. Check it first when a grid refuses all edits.
{% endstep %}

{% step %}

### Choose how editable cells look

* With **Display As Input** off (the default), editable cells look like the others. The user clicks a cell to open it as an input.
* With **Display As Input** on, every editable cell shows as an input from the start. Use it when editing is the point of the screen.

Either way, a changed cell turns yellow and stays a draft. A footer with **Cancel** and **Save** appears under the grid as soon as one value changes.
{% endstep %}

{% step %}

### Save the changes to Salesforce

On the **Interactions** tab, open **Save** and add the **Update Record(s)** action.

* It updates each edited opportunity with the fields that changed, so the flow needs no Update Records element after the screen.
* It is offered only when the data source is **Variable**: rows entered in **Manual** mode have no record to update.
* To move on once the save succeeds, add **Flow Navigation** under **On Success** and set **Type** to **Next Screen**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FWxlAOGSJ8g9lifKztq6b%2Frecord-grid-edit-and-save-values-in-a-record-grid-interactions.png?alt=media" alt="The Interactions tab of the Record Grid property editor, with an Update Record(s) action under Save and a Flow Navigation action under On Success" width="320"><figcaption><p>Update Record(s) saves the edits; On Success moves the flow to the next screen.</p></figcaption></figure>
{% endstep %}

{% step %}

### Decide what Cancel does

**Cancel** in the footer discards the drafts and puts the original values back. It saves nothing and writes nothing to the output variables. To show a message or leave the screen when the user cancels, add a **Show Toast** or **Flow Navigation** action to the **Cancel** interaction.
{% endstep %}

{% step %}

### Save and test

Debug the flow with an account that has open opportunities.

1. Change the Amount of one deal and the Close Date of another. Both cells turn yellow and the **Cancel** and **Save** footer appears.
2. Click **Save**. A **Success** toast reads "Your changes are saved.", the yellow goes away and the footer closes.
3. Open the two opportunities: they show the new values.
4. Change a value again and click **Cancel**. The original value comes back and nothing is saved.
   {% endstep %}
   {% endstepper %}

{% hint style="warning" %}
Edits live in the grid until the user clicks **Save**. If the user clicks the flow's **Next** button with yellow cells still on screen, the changes are lost and the output variables stay as they were.
{% endhint %}

## What Save does, with and without Update Record(s)

|                         | With **Update Record(s)**                                                                                | Without it      |
| ----------------------- | -------------------------------------------------------------------------------------------------------- | --------------- |
| Opportunity records     | Updated, one save per edited deal                                                                        | Unchanged       |
| Toast                   | **Success**, "Your changes are saved." On failure, **Error Updating Record** with the Salesforce message | None            |
| Yellow cells and footer | Cleared after a successful save. Kept after an error, so the user can fix the value and save again       | Cleared at once |
| **Edited Rows** outputs | Written                                                                                                  | Written         |

To use the edits later in the flow (a Decision, a loop, an Apex action), read the output variables. [Send edited Record Grid rows to Apex or a Decision](https://docs.avonnicomponents.com/flow/tutorials/components/record-grid/send-edited-record-grid-rows-to-apex-or-a-decision.md) covers them.

## Troubleshooting

<details>

<summary>A cell does not open for editing</summary>

Check, in this order:

* **Read Only** is off.
* **Editable** is on for that entry in **Row Fields**.
* The running user can edit the field. Formula fields, fields locked by field-level security and Date Time rows stay read-only.
* The row is a field of the record itself, not of a related record (`Account.Name` cannot be edited from an Opportunity grid).

</details>

<details>

<summary>Save shows "Error Updating Record"</summary>

Salesforce refused the change, for example because of a validation rule, and the toast carries its message. The yellow cells stay, so the user can correct the value and click **Save** again. Each deal is saved separately: when several deals were edited, the ones that passed may already be saved.

</details>

<details>

<summary>The user clicked Save but the records did not change</summary>

The **Save** interaction has no **Update Record(s)** action. Without it, **Save** only fills the output variables. Add the action, or save the records after the screen with an Update Records element.

</details>

## Related tutorials

* [Send edited Record Grid rows to Apex or a Decision](https://docs.avonnicomponents.com/flow/tutorials/components/record-grid/send-edited-record-grid-rows-to-apex-or-a-decision.md): use what the user changed after the screen.
* [Compare records side by side with Record Grid](https://docs.avonnicomponents.com/flow/tutorials/components/record-grid/compare-records-side-by-side-with-record-grid.md): build the grid this page makes editable.
* [Making a field editable](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/making-a-field-editable.md): the same need in a Data Table, when the records belong in a list.


---

# 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/record-grid/edit-and-save-values-in-a-record-grid.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.
