Trigger "record deleted"
Autopilot
Merged in a post:
Add "When a record is deleted" trigger for automations
J
Jordin Marshall
We definitely need the Delete Trigger.
In the case where Record B should only exist (And exists as a linked record) if Record A exists, not having a "when a record is deleted" trigger to delete the now pointless record leaves orphaned records that should only exist when the now. Basically cascade on delete functionality is missing
Noah Callen
This seems like something that can be done using Webhooks per https://developers.smartsuite.com/docs/solution-data/webhooks/create-webhook but it would be nice to have this as an option using the UI instead.
F
Federico Gonzalez
I would also like this functionality to be able to delete linked records. An example is we have a projects table and each project has linked Tasks, Payments, Documents and other records that I would like to delete when a record is deleted
Jon Darbyshire
Hello Nica Stapel! I have a few more questions for you:
- Could you please clarify which specific records you are referring to when you mention 'record deleted'?
- What kind of information would you like to be included in the email notification to the DBA?
- Are there any specific conditions or scenarios where you would not want this trigger to be activated?
N
Nica Stapel
Jon Darbyshire I mean : when we (users of smartsuite) buil an automation in one of our solutions, is it possible to have a trigger that would fire when a record (any record) is deleted in a table ? So that an admin for example, receives an email saying that this record has been deleted. To "secure" a little the data base ?
And just like the other emails in the automations, we would be able to customize the e-mail.
R
Ruben Uzan
Jon Darbyshire another use cased offered by AI when asked to guide for an automation in smartsuite, the possibility to recalculate the automated number field.
here s what the AI suggested me to do, not knowing there isn t a trigger called when a record is delete,
- automatically number your sessions and have them adjust when sessions are deleted, you'll need to use a combination of SmartSuite's features. Here's a step-by-step approach to achieve this:
Create a Number field:
In your Sessions table, add a new Number field called "Session Number".
Set it to "Auto-increment" when creating new records.
Create an automation to reorder session numbers:
Go to your Sessions table and click on "Automations".
Create a new automation.
Set the trigger to "When a record is deleted".
Set up the automation action:
Add an action: "Update Record".
In the "What records do you want to update?" section, choose "All records that match conditions".
Set the condition to "Session Number" is greater than {{Trigger.Session Number}}.
In the "What do you want to update?" section:
Choose the "Session Number" field.
Set its value to {{Session Number}} - 1.
Add a second action to sort records:
Add another action: "Sort Records".
Choose to sort by "Session Number" in ascending order.