Rule to trigger on "Entity Deleted"

It would be useful to have a “Destructor” Rule that can trigger when an entity is about to be deleted.

E.g., If the entity has linked Documents, I might want to move them elsewhere so they don’t become orphaned.

Related: Run rules on delete event

We also need this functionality. We have a use case where we would like to delete a Google Calendar item when an entity is deleted, but currently I can’t find a way to do this. I also noticed that the webhook doesn’t feed any data about the entity when deleted either, so webhooks via make.com is not an option either.

1 Like

@Chr1sG Would the back-end on this be messy? Is there a way to do this using ‘Entry unlinked’ or ‘Updated’?

Certainly, if entity A is linked to entity B, then deleting entity A can be detected with an automation in the B database (using an unlinked/updated trigger). However, there are challenges with this method

  • there is no way to detect something being deleted if it is not linked to something else
  • the actions available are limited to actions for entity B
  • the values of entity A prior to deletion are not accessible
  • you can get ‘caught out’ with false triggers, e.g. if someone decides that B should be linked to C instead of being linked to A, this will manifest as A being unlinked, even though A has not actually been deleted.
1 Like

The only way I can figure to accomplish this is to never actually delete such entities directly, but instead create an “Action” field that you can use as a trigger. When this field is set to “DELETE” for example, this would trigger the automation to do all the interesting pre-deletion things and then actually delete the entity.

But there is no way way to prevent entities from being deleted in the normal ways (manually or via automations), so this approach depends on everyone following the special “delete procedure” correctly for this DB.

2 Likes

The delete capability can actually be separated out from other capabilities when using custom access templates for sharing an entity, but this doesn’t help in the case of a database that has been shared.

1 Like