For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

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
Stage and Close Date stay open as inputs. Each change is highlighted, and the Cancel and Save bar stays until the user saves.

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

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 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

1

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.

2

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.

3

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.

4

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.

Interactions tab with an Update Record(s) item under Save, opened to show a Show Toast under On Success and another under On Error
The Save interaction writes the edits with Update Record(s) and confirms with a toast.

See Show Toast for the toast settings.

5

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.

6

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.

Troubleshooting

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

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

Edits disappear after Save or after a page refresh

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

A save failed and the user's edits are gone

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 for how the Save event works.

The pencil icon never appears

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.

Display as Input cells show larger text on a touch screen

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.

Last updated

Was this helpful?