Skip to main content

Undo changes you don't allow

Lock a field after a status. When someone edits it anyway, Tape restores the previous value and leaves a comment, without starting the automation again.

Written by Leo

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 automations is off by default for Update record, so the undo doesn't start this or any other automation. Keep it off, or the automation can start itself again and loop.

The automation Undo changes to sent invoices: When a record is updated and Amount has changed in Invoices, the filter Status Is Sent, Get previous values of the current record, Update the current record with Amount set to @Invoice / Amount / Previous value, and Add a comment to the current record

What you'll need

  • A database app Invoices with the fields Amount (number) and Status (with the option Sent).

  • To build this automation, you need to be a Workspace admin in the workspace of the Invoices app.

Undo changes to a locked field

  1. Open the Invoices app on desktop or web and click the automations icon in the top bar (tooltip Create and view automations).

  2. Select New automation, then select When a record is updated.

  3. In the trigger, select the field name. Tape preselects one of the app's fields. Select Amount under Fields, then select the preselected field again to remove it. Now only changes to the amount start the automation.

  4. Under And if the following conditions are met, select Add filter. Pick Where Status Is Sent. Now it only runs once the invoice is sent.

  5. Select Add action → Get previous values. The step reads Get previous values of the current record.

  6. Select Add action → Update record. The step already has one field row. Open its field dropdown and select Amount. In Value, type @, open Invoice previous values (the app's record name followed by "previous values"), and select Amount. Click ••• on the action, check that Trigger automations is off (it is when you add the action), and turn on Silent.

  7. Select Add action → Add comment. Enter "The amount can't change after an invoice is sent. Your change was undone."

  8. Select Create automation.

In Update the current record with the field Amount, typing @Amount in the value and choosing Amount under Invoice previous values, so the value reads @Invoice / Amount / Previous value

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 Where Last edited by Is 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 with Add field in Update record.

  • Remove unwanted comments. Use the trigger When a comment is added, add Reply to comment with your warning, then Delay execution with 30 seconds, then Delete comment. The delay gives people time to read your warning. Learn more about delay execution →

  • Tell your team. Add Send email to notify the finance lead about every undo.

Learn more

FAQs

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?

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?

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?

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 →

Did this answer your question?