🆕 Deleting multiple rows from a delete action

It has finally arrived.

17 Likes

No way!!

Finally we got this great resource :trophy:

But we can use a multiple relation in a Set Column action as well?

No, not for now.

My immediate use case:

3 Likes

What would be the best way to utilize this feature to delete a bunch of rows that are say, over 3 months old?

You could create a math column like this. `(Date+90)-Now’. If a date is older than 3 months, then it should return a negative number. Then create an IF column to check if the math number is less than zero. If it is Return ‘true’.

Then create a relation to that true value and do your delete through that relation.

3 Likes

Waiting for the delete all via API

Trying to get this to work properly as I dont want to delete the wrong stuff. Also, different scenario than deleting based on time.

Example:
I have 4 Rows, where I want to delete Rows 1 and 3 where Column A is blank.

Row 1 - Column A is empty
Row 2 - Column A is not empty
Row 3 - Column A is empty
Row 4 - Column A is not empty

I created an ITE stating, If Column A is empty - True. When I create a relation to that True value, what am I matching it to?

Relate to items where the value in:
ITE

Matches the value in:
?

Thanks!

I have a boolean column that is simply set to ‘true’. That is the column I use to create a relation to the table that has the rows I want to archive (delete in your case). It works for me because I have a single row, but if you have multiple rows, then I think you could also use a template column that simply returns ‘true’, or create a dummy IF column that always returns ‘true’.

image

I go into more detail about it here:

As a simple test before you commit to deleting a bunch of rows, maybe change your relation to a single relation to make sure it’s linking to the correct row and have it delete one row at a time. My app is a little different. I don’t delete rows, but I change the row owner email, so it becomes unowned. Eventually I will manually delete the archived rows.

1 Like

Great thanks! I think what was holding me up was that all the rows were in the same table and there was no reason to create a column in another table to connect the two. So like you said, I just created a Temp column in another Table where it only displays DELETE and changed the ITE to display DELETE if Column A is blank. Created the relation between the two and it deleted all the rows properly!

1 Like

Pretty sure you can already “delete all” via the API…but I forget how. @mark…can you refresh my memory?

You’d have to get all rows from the API and then delete them all.

Hm…I thought you could specify a series of rowIDs via a specific JSON structure to delete those rows?

In any case, you can send a bunch of rows to Make and use an iterator to delete them.

That will cost when we speak about 2k yo 3k row every now and then

Waiting for the option to delete the entire column.

You can do them in batches, but each delete row is a discrete mutation.
I do them in batches of 100, and it works okay :slight_smile:

2 Likes

Can you please explain more how to achieve it?

Now i have a bug.
In edit screen delete isn’t working both delete row in item or relation list…

How I usually do it:

  • Send a batch of rowIDs I want to delete over to Make
  • Iterate through a split array of those rowIDs
  • Aggregate them into batches of 100 using text aggregator.

  • Use HTTP calls to send calls with those batches in the body.

1 Like

I use Apps Script, but the end result is basically the same as what @ThinhDinh does with Make. Generate batches of 100 delete row mutations, and send each batch as a single API call.

1 Like