Some values should stay put once a record reaches a certain stage, such as the amount of an invoice that's already been sent. An automation can't block an edit, but it can undo it moments later. It reads the values from before the change, writes them back, and tells the person why.
Note:
The edit happens first. Tape saves the change, then the automation reverses it. Others may see the new value briefly.
Restoring a value counts as an update.
Trigger automationsis off by default forUpdate record, so the undo doesn't start this or any other automation. Keep it off, or the automation can start itself again and loop.
What you'll need
A database app
Invoiceswith the fieldsAmount(number) andStatus(with the optionSent).To build this automation, you need to be a
Workspace adminin the workspace of theInvoicesapp.
Undo changes to a locked field
Open the
Invoicesapp on desktop or web and click the automations icon in the top bar (tooltipCreate and view automations).Select
New automation, then selectWhen a record is updated.In the trigger, select the field name. Tape preselects one of the app's fields. Select
AmountunderFields, then select the preselected field again to remove it. Now only changes to the amount start the automation.Under
And if the following conditions are met, selectAdd filter. PickWhereStatusIsSent. Now it only runs once the invoice is sent.Select
Add action→Get previous values. The step readsGet previous values of the current record.Select
Add action→Update record. The step already has one field row. Open its field dropdown and selectAmount. InValue, type@, openInvoice previous values(the app's record name followed by "previous values"), and selectAmount. Click•••on the action, check thatTrigger automationsis off (it is when you add the action), and turn onSilent.Select
Add action→Add comment. Enter "The amount can't change after an invoice is sent. Your change was undone."Select
Create automation.
The result
When someone changes Amount on an invoice with the status Sent, the old amount comes back and the record gets a comment that explains why. Changes to other fields, or to invoices that aren't sent yet, stay untouched. Click ▷ next to Manual run in the automation to see every undo.
Variations
Allow some people. Add a condition on who made the change, for example
WhereLast edited byIs not, then choose your finance lead from the list of members.Lock several fields. Select more fields under
Fields, and add one row per field withAdd fieldinUpdate record.Remove unwanted comments. Use the trigger
When a comment is added, addReply to commentwith your warning, thenDelay executionwith30 seconds, thenDelete comment. The delay gives people time to read your warning. Learn more about delay execution →Tell your team. Add
Send emailto notify the finance lead about every undo.
Learn more
FAQs
Why does the automation keep running again and again?
Why does the automation keep running again and again?
Restoring the value is itself an update. It only starts the automation again if Trigger automations is on in the menu of Update record. Turn it off. Then the restore starts no automation, including this one. Learn more about loops →
Does the person who made the change get a notification?
Does the person who made the change get a notification?
No, not for the restore if you turn on Silent in the menu of Update record. The comment is a separate action with its own Silent setting.
Can I prevent the edit instead of undoing it?
Can I prevent the edit instead of undoing it?
No, not with an automation. It reacts after the change was saved. To make a field read-only, use field access: under Can edit, choose Nobody, or Selected to let only certain people edit it. Learn more about field access → This feature is only available on the Premium Plan. Learn more about plans →
Are you a developer using the Tape API for automations?
Are you a developer using the Tape API for automations?
The automation API has its own documentation for developers. Full reference: current_record_get_previous_revision in the developer docs →
Still have questions? Find answers and get help from community experts in the Tape community →
