Skip to main content

Trigger when a record is deleted

Start an automation every time a record is deleted. Notify your team, clean up related data, or keep a log, and filter by value to continue only when needed.

Written by Leo

When a record is deleted is a trigger that starts an automation every time a record in a database app is deleted (the trigger decides when an automation starts, and the filter decides whether it continues). It's meant to help you keep people informed and clean up related data when a record disappears.

You can use this trigger for many things, including:

  • Emailing the sales manager when someone deletes a deal from your pipeline.

  • Adding a comment to a related project when a task is deleted.

Creating an automation in the Expenses database app: clicking the automations icon, New automation, and When a record is deleted. The trigger reads When a record is deleted in Expenses, with an empty filter row below

Note:

  • A deleted record is gone from the database app. The automation can still use the field values the record had when it was deleted, in the filter and in actions.

  • Records that are still being created don't count. Discarding a record before it's been created doesn't start the automation.

  • Test with care. A manual run has real effects.

Who can use the When a record is deleted trigger?

  • Automations are available on all plans: Free, Plus, and Premium. The number of automation actions per month depends on your plan. See the limits for your plan on our pricing page.

  • To create, edit, pause, run, or delete automations, you need to be a Workspace admin in the workspace the database app belongs to. Only workspace admins see the automations button in a database app.

Set up the When a record is deleted trigger

To set up the trigger:

  1. Open the database app and click the automations icon at the top right (Create and view automations).

  2. Select New automation.

  3. Select When a record is deleted from the list of triggers.

  4. Add a filter if the automation should only continue for certain values. Learn more about filters below →

  5. Select Add action and choose what should happen.

  6. Select Create automation.

The trigger When a record is deleted in Expenses in the automation editor

The trigger reads like a sentence: When a record is deleted in {app}. It has no settings of its own, so there's nothing to choose except the database app.

To give the trigger your own name, select its name and type a new one.

Filter the When a record is deleted trigger

The filter decides whether the automation continues after it's been triggered. Under And if the following conditions are met, select Add filter and build a condition: Where {field} {option} {value}. For example, continue only when the Amount of the deleted record is over a limit. Learn more about filters →

Let's look at an example

Let's say you want to know when a deal is deleted from your pipeline. Here's how:

  1. Set the trigger to When a record is deleted in Deals.

  2. Add the filter Where Stage Is Negotiation.

  3. Select Add action → Send email.

  4. Enter the address of your sales manager in To, for example [email protected].

  5. Enter "A deal was deleted" as the Subject, and write a short message.

  6. Select Create automation.

The next time someone deletes a deal in negotiation, the manager should get the email!

When a record is deleted errors

  • If the status next to the automation's name shows Broken in red, part of the automation doesn't fit the trigger, often an action that needs a current record. The part that doesn't fit is shown in red. While the automation is Broken, it doesn't run and you can't start a manual run. Tape then shows Trigger runs manually not possible because of broken automation.

  • If a run fails, you can see each step and its message in the automation's runs. To see the runs of an automation, click the play button next to Manual run at the top right of the editor (View all runs), or use cmd/ctrl + 1. The Runs panel lists the runs of the last 30 days. Select a run to see each step and its message. To see the runs of all automations, select Runs in the sidebar of the Automation Center.

  • Lots of automation activity in a short time can delay automations across your organization. The delay is temporary. Tape checks the load again shortly and runs waiting automations automatically. Learn more about limits and throttling →

Test, pause, edit, or delete an automation with this trigger

  • Manual run runs the automation on existing records you choose, as if they had been deleted. The records aren't deleted.

  • New automations you create in the editor are Active right away. To pause one, select Active next to the automation's name. It switches to Paused. Select it again to turn the automation back on.

  • To edit an automation, open the database app, click the automations icon at the top right, then select the automation. Select Save changes when you're done.

  • To delete an automation, open it and click ••• at the top right, then select Delete. Confirm with Delete. You can also click ••• next to the automation in the list of automations, then select Delete. Deleting can't be undone.

  • To switch to another trigger, hover over the trigger and click ••• to the right of it, then select Turn into and choose a trigger. The filter and the actions stay. If an action or a filter condition doesn't fit the new trigger, for example Update record after switching to a schedule, or Has changed after switching away from When a record is updated, the status next to the automation's name turns red and shows Broken until you change or remove it.

Learn more

FAQs

Can I restore a record from the automation?

Yes! Add Restore record to an automation with this trigger. It brings the deleted record back right away, and the record shows in the database app again. Learn more about Restore record →

Does this trigger run when another automation deletes a record?

Only if Trigger automations is turned on in the settings of the Delete record action. It's off by default. Learn more about action settings →

Does it run when I delete a whole app?

No. When you delete a whole app, Tape deletes its automations first, so its records don't start When a record is deleted. If you delete several records at once, the automation runs once for each record.

How can I see what was in the record before it was deleted?

You don't need Get previous values. The automation can use the field values the record had when it was deleted, in the filter and in actions. Learn more about Get previous values →

Are there other triggers I can use?

Yes! An automation can start when a record is created, updated, or deleted, when a comment is added, when a date arrives, on a schedule, and more. See every trigger in Automation triggers →

Are you a developer using the Tape API for automations?

The automation API has its own documentation for developers. Full reference: Triggers in the developer docs →

Still have questions? Find answers and get help from community experts in the Tape community →

Did this answer your question?