Nov 04, 2021 02:25 PM
Hey, I’m struggling to create an automation that sends an email (to myself) when any record under a field in a specific table is deleted. I thought the ‘When record updated’ trigger would work, but it seems I’d need something more custom.
For context, I’m using Airtable as a database for a booking app, and my goal is to receive an email when a user deletes/cancels their booking on the app (this action already deletes the corresponding record in Airtable).
Any help is appreciated.
Tunmise
Nov 04, 2021 06:26 PM
Welcome to the community, @Tunmise_Alakija!
Deleting a record isn’t a supported trigger, and there is also no action to delete a record.
So you’d have to approach this in a different way. You could create a checkbox field that when you check it, it triggers your automation for sending the email. But then you would need to write a JavaScript to delete your record for you. Or you could manually delete the record on your own.
Alternatively, you could use an external automation tool like Zapier or Integromat which could monitor that checkbox field for you, and when it sees the field checked, it could both send the email & delete the record for you.
Nov 04, 2021 08:15 PM
Welcome to the Airtable community!
As Scott mentioned, there is no trigger for when a record is deleted.
If the deleted record were linked to a different record, it is possible to base a trigger off of a change in the linked record field in that other record. For example, you could have a user table, and for each user there would be a linked record field for the appointment, and editable field that states if an appointment has been made. When the appointment record is linked, also set the editable field to say there is an appointment. Then watch for the condition where the editable field says there is an appointment, but there is no linked appointment record. When that condition occurs, send your notification email, and reset the editable field.
However, one of the difficulties is that once a record is deleted, the system no longer has access to any the data that was in the deleted record.
Apr 03, 2023 12:01 PM
@Tunmise_Alakija - My use case isn't exactly as yours, but I can let you know what i did to accomplish this as a secondary objective.
I wanted to create a safeguard in our CRM so that when someone deletes a lead, we retain a backup, & we get a slack notification that a record was deleted.
So here are the steps i took: