record_update()
Update one or more fields on an existing record.
Syntax
record_update(table, id, data, opts?)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
table |
string or number | yes | The table's name, its database table name, or its numeric table id. Read the id from $table at run time (for example $table["fields"]["client"]["lookup_table"]); never type one into your code, because table ids change when a workspace is copied. A table whose name happens to be a number always wins over the table with that id. |
id |
int | yes | The record's primary key. |
data |
array | yes | Field values to change, keyed by field id. Fields you omit are left unchanged. |
opts |
array | no | Options. ["silent" => true] suppresses notifications to the record's followers. |
Returns
The record as it is after the update, in the same shape as record_get(). Throws if the record is not found.
Assign it back to your variable so later steps read the new values:
$record = record_update("deals", $record["_meta"]["id"], [
"stage" => "won",
"closed_on" => sys_current_date()
]);
Example
record_update("deals", $record["_meta"]["id"], [
"stage" => "won",
"closed_on" => sys_current_date()
]);
Example output
["id" => 42, "stage" => "won", "closed_on" => "2026-08-07", "_meta" => ["id" => 42, "title" => "Acme"]]
Setting file fields
A file field's value is an array of file items. From an automation you can set one without a manual upload — each item is one of:
record_update("deals", $id, [
// 1. copy a file off another record — InfoLobby stores an independent copy
"contract" => record_get("templates", 5)["contract"],
// 2. fetch from a URL
"attachments" => [
["url" => "https://example.com/report.pdf", "name" => "report.pdf"]
],
// 3. build from base64 (raw base64 or a data: URI)
"logo" => [
["data" => $base64String, "name" => "logo.png", "type" => "image/png"]
]
]);
- Copying a file from another record makes a separate copy, so deleting the source record never removes this one's file.
- URL items are fetched server-side (public HTTP/HTTPS only) and capped at 50 MB.
- base64
datamay be raw base64 or adata:<mime>;base64,...URI. - You can mix existing files and new items in the same array (the array replaces the
field's whole file list). If any file can't be fetched, decoded, or copied, the
whole
record_updatefails — the record is never left half-changed.
Notes
- Only the fields you pass are changed; everything else stays as-is.
- Fields marked Required are checked against how the record will look after your change, so one you don't pass is satisfied by its current value. Blanking one throws. If the record already has an empty required field, every update to it throws until you fill it, so pass that value along with your change.
$recordin an automation is a snapshot taken when the automation started. In the visual builder an Update Record step refreshes it for you. In code mode, assign the return value back yourself, or later steps will still see the old values.- The change is recorded in activity history but does not trigger other automations.
["silent" => true]mutes follower notifications only; newly-assigned users are still notified. See Notifications.
See also: record_create(), record_get()