StableAction
Update record
Overview
Changes fields of an existing record — the current row, the record of a detail page or any id you provide.
Purpose
Use it for status changes (“Mark as paid”), inline edits, assigning staff, or saving an edit form. Only the fields you provide are changed; everything else stays as it is.
Inputs
- Entity — the entity of the record.
- Which record (id) — defaults to
Current record › id(the row or detail record in scope). Can also bePage parameters › id,Event › idorAction results › last result id. - Use values from the surrounding form — copy the enclosing form's values into matching fields.
- Set fields / Also set — field values to write, static or dynamic.
Configuration
- On a table row button or a card, keep
Current record › idso the right row is updated. - On a page with route
/jobs/:id, usePage parameters › id. - For an edit form, set the Form's mode to “Edit an existing record” and bind its data to the record; then this action with Use values from the surrounding form saves the changes.
Outputs
- Last result — the updated record with its new values.
- Every action that returns something also updates last result (
Action results › last result) and last result id (last.id), so the next action can use it without naming a result key.
Example
Mark a job as done
Example
Button “Done” (inside a Jobs table row) › On click:
1. Update record
Entity: Jobs
Which record (id): Current record › id
Set fields: Status = “done”, Completed on = Event › value
2. Show message “Job completed” (success)Errors
- “No record selected.” — the id evaluated to an empty value; check the record binding.
- “Record not found.” — the id does not exist or the user is not allowed to see that record.
- “That change would move the record outside what you can access.” — an own-records rule would no longer match after the change.
- Validation messages such as “Price must be at least 0” come from the field rules. Read-only fields for the user's role are silently ignored.
Limitations
- Updates one record. Updating many records needs a workflow with Find records + Repeat for each.
- If an action fails, the remaining actions in the list are skipped and an error message is shown to the user.
Advanced
- Schema:
{ type: "update_record", entityId, recordId: Binding, fromForm?, values? }. Runs on the server;id,created_at,updated_atandcreated_byare stripped from the patch. - Fires
record_updatedworkflows with the previous values available as{{event.before.<field_key>}}.