Cascade deletes with Integromat

We have a few collections tied to each other through a common ID - a typical 1:many scenario for databases.
We would like to be able to set up a “cascade delete” - wherein when we delete the primary record (a user record), we also take all all records in a related collection that are keyed to the primary record by a common userid.
Adalo help suggests using Integromat - but we haven’t yet delved there for any services, absolute novices there. Does anyone have experience with using Integromat to do a nice clean scrub of a database, so that when you trigger to delete a user record, it it convinced to do a cull of all 1:many records associated with that in other collections?

First, instead of deleting user record from Adalo, I would create a new boolean (true/false) field in user called “to be deleted” or similar. When you want to delete in Adalo, simply set this field to true.

Integromat has pre-made Adalo connections, so super easy to setup. Once you create your connection to each collection (user and second collection) you’d create a new scenario like this (I think this will work, you will obviously test first):

  1. Watch Adalo user records by updated date
  2. Add an iterator (tools button at bottom of scenario screen) and use the relationship field to the other collection from user record in step 1 (it should be an array)
  3. (important) add a filter between user and iterator to only allow when the “to be deleted” field is set to true (make sure you use the Integromat “true” string, don’t just type the word “true”)
  4. Add Adalo delete module after iterator to delete the record ID of that collection (the iterator will do each record in the array)
  5. Finally add a delete module to delete the user record based on record ID (from step 1). This step may work after step 1 too, you’ll have to test.

I think that would work!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.