Docs
Tutorials
How-to guides
Reference
Explanation
Release notes
Search
Docs
/

Editable Rows

Rows of a list can be edited in place: an Input block inside a For Each over a query writes to the Record the row shows, and a CRUD Save button saves it. A row can be edited when Ligantic can tell which Record it is.

The rule: a value can be written when its Record can be identified, which means its Schema and its id are known. For a query that returns chosen columns, that means select the Record's id. The id column does not need to be shown anywhere.

Which Values Can Be Edited

Data

Editable?

A For Each item over a query that returns whole Records

Yes, every field of the Record.

A For Each item over a query with selected columns that include the id

Yes, every column that is a field of the Record. A column with a different output name still writes to its field (an output name Title for the property Name writes Name), and so does a field inside an object column.

A column that is an aggregate (a count, a sum), a group key, or a standard property (createdAt, updatedAt and so on)

No: read-only.

A For Each item over a records column (linked Records listed under each row) that includes the id

Yes. The linked Records belong to the Schema at the other end of the relationship, and saves go to that Schema.

A row of a query grouped by a relationship

The group's linked Record (for example, the Stage of a board grouped by Stage) can be targeted by a CRUD action, but its fields are not loaded, so there is nothing to edit in the row itself.

A row of a query grouped by a property, or of a query with selected columns but no id

No: the row is not a Record.

An entity context

Yes, as before. An entity context with a literal schema holds an unsaved value that Inputs may write but CRUD actions cannot save.

A query's own datum (the whole list) is read-only: iterate it with a For Each to edit its rows.

Edit a Row Inline

  1. Add a block with a Query, and inside it a block with For Each over the query.
  2. If the query returns selected columns, make sure the columns include the Record's id.
  3. Inside the For Each block, add an Input block. Its Datum picker offers only datums that can be written: entity contexts, and For Each items that are Records. For an item of a query with selected columns, the Path picker offers only the columns that write to a field.
  4. Add a Button with the CRUD action Save, and set its Target to the For Each item. A CRUD action without a target saves the nearest enclosing entity context, not the row, so target the row explicitly.

What Viewers See

  • The rows come from the query: editing or saving a row makes no extra request to load it.
  • A row is shown as the query returned it until it is first edited. Unsaved edits to a Record show everywhere the experience shows that Record, for example in another list or an entity context.
  • Saving sends only the fields that changed: every unsaved change to the Record, including changes made to it elsewhere in the experience. After a save, the row shows the saved value until the query returns the Record again.
  • When the query returns new data while a row has unsaved edits, the edits are kept and the other fields update.
  • Edits made while a save is in progress are kept as unsaved changes for the next save. Saves of the same Record, from any button, are sent one after another, and each sends only what is still unsaved.

Validation

In the Experience designer, a Button whose CRUD action cannot save its target is outlined as needing setup, with the reason in its badge. This happens when the target is:

  • a query (target a For Each item of a row instead);
  • a For Each item whose rows are not Records, for example a query with selected columns but no id;
  • a For Each item, with the Create operation: a row is already a Record, so use Save or Update. A Create action on a row fails when clicked;
  • an entity context with a literal schema, or a parameter;
  • missing: there is no target and no enclosing entity context.

Inputs and Set Data targets are not checked this way, because they may write unsaved values that are never stored.

Limitations

  • A column that reads an array item by index (for example tags.0) is read-only.
  • File fields can be uploaded from rows of a query that returns whole Records, but not from rows of a query with selected columns.
  • Saving several edited rows at once from one button is not supported yet: each row needs its own Save, or an entity context per row inside a batch.

Related pages

Page not found. It may have moved or may not be published.
Browse documentation