# 🆕 Deleting multiple rows from a delete action

**URL:** <https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734>\
**Category:** Ask for Help\
**Tags:** actions\
**Created:** [November 23, 2022, 12:40am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734 "2022-11-23T00:40:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 23, 2022, 12:40am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/1 "2022-11-23T00:40:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/0/40af5c99c25354f0cd6fb259d134c2212f43107a.png)

It has finally arrived.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [November 23, 2022, 1:19am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/2 "2022-11-23T01:19:23Z")

</div>

No way!!

Finally we got this great resource 🏆

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 23, 2022, 1:37am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/3 "2022-11-23T01:37:44Z")

</div>

No, not for now.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 23, 2022, 6:17am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/4 "2022-11-23T06:17:31Z")

</div>

My immediate use case:

---

<div class="post-metadata">

**Author:** ![Joe\_Gabriele](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/joe_gabriele/32/57595_2.png) [@Joe\_Gabriele](https://community.glideapps.com/u/Joe_Gabriele)\
**Post date:** [November 23, 2022, 2:15pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/5 "2022-11-23T14:15:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 23, 2022, 3:15pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/6 "2022-11-23T15:15:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Yasin\_Hassanien](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yasin_hassanien/32/9042_2.png) [@Yasin\_Hassanien](https://community.glideapps.com/u/Yasin_Hassanien)\
**Post date:** [November 23, 2022, 5:00pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/7 "2022-11-23T17:00:11Z")

</div>

Waiting for the delete all via API

---

<div class="post-metadata">

**Author:** ![Joe\_Gabriele](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/joe_gabriele/32/57595_2.png) [@Joe\_Gabriele](https://community.glideapps.com/u/Joe_Gabriele)\
**Post date:** [November 23, 2022, 9:19pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/8 "2022-11-23T21:19:50Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 23, 2022, 9:32pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/9 "2022-11-23T21:32:54Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/5/75b85b69c02786219961eb4411155f760c6e9274.png)

I go into more detail about it here:

> [@Auto Archiving, Sanity Check, Reusable Forms, etc](https://community.glideapps.com/t/auto-archiving-sanity-check-reusable-forms-etc/44544):
>
> I wanted to share a few techniques that I just implemented in my app. A little background…I’m building a process in my app that will replace the email address with a template value. What it does is replace user@email.com with ARCHIVE-user@email.com. The email column is a row owner column. Once ARCHIVE is appended to the email, it becomes an unowned row and is permanently hidden from the app. I’m doing this in an effort to speed up my app by hiding data that’s more than 2 years old. Unowned…

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.

---

<div class="post-metadata">

**Author:** ![Joe\_Gabriele](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/joe_gabriele/32/57595_2.png) [@Joe\_Gabriele](https://community.glideapps.com/u/Joe_Gabriele)\
**Post date:** [November 23, 2022, 9:41pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/10 "2022-11-23T21:41:28Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 23, 2022, 10:09pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/11 "2022-11-23T22:09:37Z")

</div>

> [@Yasin\_Hassanien](#):
>
> Waiting for the delete all via API

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

---

<div class="post-metadata">

**Author:** ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)\
**Post date:** [November 24, 2022, 1:41am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/12 "2022-11-24T01:41:01Z")

</div>

> [@Robert\_Petitto](#):
>
> Pretty sure you can already “delete all” via the API

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

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 24, 2022, 1:44am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/13 "2022-11-24T01:44:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Yasin\_Hassanien](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yasin_hassanien/32/9042_2.png) [@Yasin\_Hassanien](https://community.glideapps.com/u/Yasin_Hassanien)\
**Post date:** [November 24, 2022, 2:25am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/14 "2022-11-24T02:25:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [November 24, 2022, 2:31am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/15 "2022-11-24T02:31:01Z")

</div>

Waiting for the option to delete the entire column.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 24, 2022, 3:49am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/16 "2022-11-24T03:49:27Z")

</div>

> [@Robert\_Petitto](#):
>
> Pretty sure you can already “delete all” via the API…but I forget how. @mark…can you refresh my memory?

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 🙂

---

<div class="post-metadata">

**Author:** ![Yasin\_Hassanien](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yasin_hassanien/32/9042_2.png) [@Yasin\_Hassanien](https://community.glideapps.com/u/Yasin_Hassanien)\
**Post date:** [November 24, 2022, 6:11pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/17 "2022-11-24T18:11:16Z")

</div>

Can you please explain more how to achieve it?

---

<div class="post-metadata">

**Author:** ![Voffs](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/voffs/32/879_2.png) [@Voffs](https://community.glideapps.com/u/Voffs)\
**Post date:** [November 24, 2022, 6:59pm UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/18 "2022-11-24T18:59:08Z")

</div>

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

 ![Точечный рисунок](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/6/96f7e84ecd81dc268ec59b807cf3b2ab4af10148.jpeg)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 25, 2022, 12:41am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/19 "2022-11-25T00:41:57Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/8/3828915c5752b357481afd229223d5ab540afe94.jpeg)

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.

 ![Hartic - Delete Order x Precincts Make 2022-11-25 at 7.33.06 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/0/f08fe9a3042a5a6fe0060fa5548130893758794f.jpeg)

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

 ![Hartic - Delete Order x Precincts Make 2022-11-25 at 7.41.15 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/c/ac63ed13b194adf0118ec215b49ece067d7d40ad.jpeg)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 25, 2022, 2:34am UTC](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734/20 "2022-11-25T02:34:07Z")

</div>

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.

[Next page](https://community.glideapps.com/t/deleting-multiple-rows-from-a-delete-action/54734.md?page=2)
