3. Update Record
update(slug, id, values [, options])
async· returnsEntity
Updates an existing record. Only the fields you provide in values are changed — partial / PATCH-style update. ModifyDate and ModifyUser are updated automatically.
Prop
Type
const updated = await context.functions.update(
"orders",
context.record.ID,
{ Status: "shipped", TrackingNumber: "1Z999AA1234567" }
);
Returned value — the full Entity after the update, including unchanged fields. Note that ModifyDate and ModifyUser are automatically updated by the system:
"Attributes": {
"ID": "55",
"ClientName": "Acme Corp",
"Amount": 1500.00,
"Status": "shipped",
"TrackingNumber": "1Z999AA1234567",
"CreateDate": "2026-03-01T09:00:00Z",
"CreateUser": {
"ID": "7",
"FullName": "John Smith"
},
"ModifyDate": "2026-03-12T10:30:00Z",
"ModifyUser": {
"ID": "7",
"FullName": "John Smith"
},
"SystemStatusID": {
"ID": "1",
"Name": "Active"
}
}
updateBulk(slug, values [, options])
async· returnsvoid
Updates multiple records at once. Supports two distinct usage patterns depending on whether you want to update records by filter or by targeting specific IDs.
Prop
Type
Targets all records matching a filter condition and applies the same field values to each.
await context.functions.updateBulk("notifications", {
filter: { field: "UserId", operator: "Equal", value: context.user.id },
values: { IsRead: true }
});
Targets specific records individually, each with its own set of field values.
await context.functions.updateBulk("orderlines", [
{ [lineItem1.ID]: { TotalCost: 150.00, CostRate: 50.00 } },
{ [lineItem2.ID]: { TotalCost: 300.00, CostRate: 75.00 } },
{ [lineItem3.ID]: { TotalCost: 90.00, CostRate: 30.00 } }
]);