> 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/dynamic-components/tutorials/components/data-table/enable-inline-editing.md).

# Enable Inline Editing

Let users correct amounts, stages and dates straight in the Data Table, then write every change back to Salesforce with a single Save.

Every Monday a sales manager reviews her team's open deals. Instead of opening each Opportunity, she fixes the amount, moves the stage and pushes the close date directly in the table, then saves all her changes at once.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FvbrgtAD7n3cTCMOkIO7J%2Fdata-table-tutorial-enable-inline-editing-result.png?alt=media" alt="Open deals Data Table with Stage shown as dropdowns and Close Date as date inputs, one changed close date and one changed stage highlighted, and the Cancel and Save bar under the table"><figcaption><p>Stage and Close Date stay open as inputs. Each change is highlighted, and the Cancel and Save bar stays until the user saves.</p></figcaption></figure>

Prefer to click through it first? This interactive demo walks through the same setup.

{% @arcade/embed url="<https://app.arcade.software/share/SryMD6RG4XMf90xqbu4F>" flowId="SryMD6RG4XMf90xqbu4F" %}

## Before you start

* A Data Table with a **Query** data source. The **Update Record(s)** action that saves the edits is only offered for a query. See [Data Table](https://docs.avonnicomponents.com/dynamic-components/components/data-table.md) to set one up.
* Users need edit access to the records and fields they change, or the save fails.

## Two ways to edit a cell

Each column uses one of two editing styles. You can mix them in the same table.

| Column setting       | What the user sees                                              | Best for                                           |
| -------------------- | --------------------------------------------------------------- | -------------------------------------------------- |
| **Editable**         | A normal cell with a pencil icon. A click opens a small editor. | Tables people mostly read and occasionally correct |
| **Display as Input** | The cell is always an input field or a dropdown.                | Data entry across many rows                        |

## Steps

{% stepper %}
{% step %}

### Make a column editable

1. In the **Properties** tab, open **Data Mappings** and click the column, for example **Amount**.
2. Turn on **Editable** for the pencil style, or **Display as Input** for an always-open field.
3. Click **Save** in the column editor.

Repeat for each column users should change. Not every column type can be edited: **Badge**, **Avatar** or **Progress Bar** columns, for example, have no **Editable** setting.

To make every compatible column editable at once, open the **Content** section, click **Advanced Options**, and turn on **All Columns Editable** or **All Columns Display as Input**.
{% endstep %}

{% step %}

### Pick the right type for picklists and lookups

The column **Type** decides which editor the user gets.

* A picklist such as **Stage** uses the **Combobox** type: the user picks from the field's values. Keep **Editable** on, even with **Display as Input**: without it the values do not load and the cell stays plain text.
* A lookup such as **Account** uses the **Lookup** or **Record Picker** type, so the user chooses another record.
* A date field such as **Close Date** uses **Date Local**. The **Date** type is for date/time fields and adds a time box. Amounts use **Currency**.
  {% endstep %}

{% step %}

### Lock some rows with a formula (optional)

A column does not have to be editable on every row. Say the **Amount** of a closed deal must stay frozen:

1. In Setup, create a checkbox formula field on Opportunity, for example `Amount_Editable__c`, with the formula `NOT(IsClosed)`.
2. Add that field to the table's query.
3. In the **Amount** column, next to **Editable**, turn on **Field Name** and select `Amount_Editable__c` instead of using the toggle.

The pencil now appears on open deals only. Closed Won and Closed Lost rows stay read-only.
{% endstep %}

{% step %}

### Add the Save interaction

Editing a cell only changes what the user sees. Nothing reaches Salesforce until the **Save** interaction runs.

1. Open the **Interactions** tab.
2. Look under **Save**. The builder usually adds an **Update Record(s)** item there when a column becomes editable. If **Save** is empty, click **Add Save** and set **Type** to **Update Record(s)**.
3. Open the item to set what happens next.
4. Under **On Success**, add a **Show Toast** so users know their changes are saved. Under **On Error**, add a **Show Toast** with the Error variant.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FHSZxDZa8RZ0Visd7uIjs%2Fdata-table-tutorial-enable-inline-editing-save-interaction.png?alt=media" alt="Interactions tab with an Update Record(s) item under Save, opened to show a Show Toast under On Success and another under On Error" width="480"><figcaption><p>The Save interaction writes the edits with Update Record(s) and confirms with a toast.</p></figcaption></figure>

See [Show Toast](https://docs.avonnicomponents.com/dynamic-components/component-builder/interactions/show-toast.md) for the toast settings.
{% endstep %}

{% step %}

### Tune the Save and Cancel bar (optional)

As soon as a user changes a cell, a bar with **Cancel** and **Save** appears under the table. In the **Content** section:

* **Always Display Bottom Bar** keeps the bar visible even before any change.
* **Suppress Bottom Bar** hides it. Leave it off: without the bar, users have no **Save** button.
* **Max Row Edit and Selection** (under **Advanced Options**) caps how many rows can be edited or selected at once. A row that is both edited and selected counts once.
  {% endstep %}

{% step %}

### Save and test

Click **Save**, then open the Lightning page where the component is placed. Interactions that write data do not run in **Preview**.

Change the **Amount** on one row and the **Stage** on another. The edited cells are highlighted and the **Cancel** / **Save** bar appears. Click **Save**: your success toast shows and the new values stay in place after a page refresh.

A row number column also appears on the left. The table always shows it while at least one column is **Editable**, even with **Show Row Number Column** off.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>Save shows "The interaction "Update Record(s)" is not executed in Preview."</summary>

This is expected. **Update Record(s)** never writes data from the builder's **Preview**. Test on the activated Lightning page instead.

</details>

<details>

<summary>Edits disappear after Save or after a page refresh</summary>

The **Save** interaction is missing, or its **Type** is not **Update Record(s)**. Open the **Interactions** tab and check the **Save** list.

</details>

<details>

<summary>A save failed and the user's edits are gone</summary>

When **Update Record(s)** fails (a validation rule, a required field, a missing permission), the same error message is shown on every edited row, and the values the user typed can be lost. Add a **Show Toast** under **On Error** so the message is visible, fix the cause, and suggest users save often during long edits. See [Data Table](https://docs.avonnicomponents.com/dynamic-components/components/data-table.md#save) for how the Save event works.

</details>

<details>

<summary>The pencil icon never appears</summary>

Check that **Read Only** is off in the **Content** section. Then check the column **Type**: only types that accept input (text, number, currency, date, picklist and similar) offer **Editable**. Formula fields are read-only in Salesforce and cannot be edited from the table.

</details>

<details>

<summary>Display as Input cells show larger text on a touch screen</summary>

On touch devices, every input field gets a 16px font so phones do not zoom on focus. The rest of the table stays at 13px, so input cells look bigger. This is a known issue. Desktop browsers with a mouse are not affected.

</details>

## Related tutorials

* [Enable Bulk Editing](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/enable-bulk-editing.md): update one field on many selected rows in one step.
* [Configure Header Actions](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/configure-header-actions.md): add buttons above the table, such as a Bulk Edit button.
* [Apply Conditional Cell Styling](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/apply-conditional-cell-styling.md): highlight the values users should review before editing.


---

# 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/dynamic-components/tutorials/components/data-table/enable-inline-editing.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.
