# Delete Row for "Create new action..." workflows

**URL:** https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390
**Category:** Ask for Help
**Tags:** actions
**Created:** [January 19, 2021, 2:17am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390 "2021-01-19T02:17:23Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![ray\_d](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@ray\_d](https://community.glideapps.com/u/ray_d)
#### Post date: [January 19, 2021, 4:30pm UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/21 "2021-01-19T16:30:44Z")

</div>

I’m actually the opposite-- I haven’t done a script in Sheets yet 😱 lol  
I like the visual nature of Integromat so will try this first. Thanks!

---

<div class="post-metadata">

### Author: ![ray\_d](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@ray\_d](https://community.glideapps.com/u/ray_d)
#### Post date: [January 20, 2021, 2:49am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/22 "2021-01-20T02:49:42Z")

</div>

@SantiagoPerez So I am trying to do the delete row function in integromat but I get stuck on this screen. Is there a way to delete a row that matches 2 specific cell values?  
I’m trying to do an “Unfollow” action for a social network, so it is checking a UserToUserRelation sheet to find a row that has a specific Follower ID and Followee ID which I’m able to pass to Integromat.

Anyone know if this is possible?

 ![Integration_Webhooks __Google_Sheets___ Integromat](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/d/2d50f07f1cea4fb3ec5071208bb2e8b1e52264e5.jpeg)

---

<div class="post-metadata">

### Author: ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)
#### Post date: [January 20, 2021, 10:18am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/23 "2021-01-20T10:18:44Z")

</div>

Hola @ray_d,

If I understand correctly, that information isn’t actually written in the GS. Any info coming from a relation, lookup, rollup, etc. doesn’t get written in GS.

How are you passing it to the GS? I guess that’s where we need to start. What’s the specific value in the GS that you need the scenario to look at?

---

<div class="post-metadata">

### Author: ![ray\_d](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@ray\_d](https://community.glideapps.com/u/ray_d)
#### Post date: [January 20, 2021, 9:28pm UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/24 "2021-01-20T21:28:34Z")

</div>

I’m not trying to write to the Google Sheet. I’m trying to pass user Row ID’s (follower and person being followed) to the google sheet to identify which row to be deleted. I see that Integromat looks for the Row Number, so I was wondering if I pass the Row ID’s to look for, then with some logic in integromat, it would be able to find the right row number to delete. Do you know if this is possible?

Or is there a way to find the Google Sheet row number in Glide before I send it to Integromat? 🤔

---

<div class="post-metadata">

### Author: ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)
#### Post date: [January 20, 2021, 9:30pm UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/25 "2021-01-20T21:30:19Z")

</div>

I don’t know if that’s possible. Maybe @gvalero could shed some light 💡 on it.

---

<div class="post-metadata">

### Author: ![wjcv06](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wjcv06/32/12747_2.png) [@wjcv06](https://community.glideapps.com/u/wjcv06)
#### Post date: [January 20, 2021, 10:57pm UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/26 "2021-01-20T22:57:24Z")

</div>

Maybe you can create a column with the number of row next to ROW ID, so you can send the row number to INTEGROMAT

---

<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: [January 20, 2021, 11:05pm UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/27 "2021-01-20T23:05:21Z")

</div>

Let me test to verify some details. The point here is to know and mark the right row (someting like ROW\_ID that @wjcv06 says) dynamically to hep Integromat,

Saludos

---

<div class="post-metadata">

### Author: ![wjcv06](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wjcv06/32/12747_2.png) [@wjcv06](https://community.glideapps.com/u/wjcv06)
#### Post date: [January 20, 2021, 11:09pm UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/28 "2021-01-20T23:09:22Z")

</div>

The only “problem” is that for example I wanna delete row number 5 and you wanna delete row number 6, when Integromat deletes my row (number 5), row number 6 becomes row number 5 in GoogleSheets so when Integromat deletes row number 6 actually will eliminate former row 7 😕

I think this is the best option ↓

> [@Delete Row for "Create new action..." workflows](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/3):
>
> The way I normally handle deletions is as follows: I have a column in my table called “Is Deleted?” (for simplicity, I just use a number column) I present a “Delete” button to the users When a user taps on delete, I increment the value of “Is Deleted?” by 1 I then use a visibility condition to immediately remove the item from view In some cases, I’ll have a trigger function running in the background that removes any “Is Deleted?” rows from the GSheet. In other cases, I’ll actually leave the …

---

<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: [January 21, 2021, 12:49am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/29 "2021-01-21T00:49:34Z")

</div>

The trick is to delete rows from botton to top. This is what @Darren_Murphy wrote above.

You will have this problem using GS Script as well if you delete rows from top to botton.

Saludos!

---

<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: [January 21, 2021, 1:35am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/30 "2021-01-21T01:35:13Z")

</div>

Correct, here…

> [@Darren\_Murphy](#):
>
> another thing I should point out about the script I posted above (which may not be immediately obvious) is that when processing a sheet, it starts from the bottom and works its way up. This is absolutely _vital_ . If you start from the top and work down, then you run the risk of deleting the _wrong_ rows. This is because as soon as you delete a row, the indexes of all the following rows will change, and so you have an immediate off by one error.
> 
> Working from the bottom up avoids this problem. When you delete a row, the row indexes below will still change. But because those rows have already been processed, it doesn’t matter.

Another thing that is _critical_ when deleting rows using a trigger script is to make absolutely _certain_ that you’re referring to the correct column index as a trigger. I managed to accidentally delete an entire sheet (over 1000 rows) by getting careless with this (thank goodness for GSheet versioning). This is why I now _ALWAYS_ use column 2 as my trigger column.

I actually now prefer to avoid deleting rows unless absolutely necessary, and instead do a “soft” delete by marking them as deleted with a timestamp, and then just use the presence of that timestamp to hide them from view.

---

<div class="post-metadata">

### Author: ![ray\_d](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@ray\_d](https://community.glideapps.com/u/ray_d)
#### Post date: [January 21, 2021, 1:55am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/31 "2021-01-21T01:55:18Z")

</div>

Ok I see now why delete may not be necessary… that checkbox approach is genius! I’ll see if that will work via `Create new action > Set row > Deleted = true`

I guess only downside is that this leaves a bunch of unused rows, but I guess you can manually delete these rows later.

---

<div class="post-metadata">

### Author: ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)
#### Post date: [January 21, 2021, 2:32am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/32 "2021-01-21T02:32:17Z")

</div>

> [@Darren\_Murphy](#):
>
> I managed to accidentally delete an entire sheet (over 1000 rows) by getting careless with this (thank goodness for GSheet versioning). This is why I now _ALWAYS_ use column 2 as my trigger column.

This is interesting, yet all too real today. I literally just lost an entire inline list of posts (and post stats; 20 days worth) due to wrong Col clear 🥴

I’ve taken note of using specific columns for specific variable types (text, number, date/time, etc.)

However, would it be possible to write a script if the Col used was a timestamp - and the row deletion (starting from the bottom 👍🏻), was determined if NOW is -AFTER- Timestamp? 🤔

Learning curve is welcomed - thanks in advance!

---

<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: [January 21, 2021, 2:37am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/33 "2021-01-21T02:37:54Z")

</div>

> [@ehdubya](#):
>
> However, would it be possible to write a script if the Col used was a timestamp - and the row deletion (starting from the bottom 👍🏻), was determined if NOW is -AFTER- Timestamp?

Yes, that’s certainly possible. Although probably much simpler to do that logic in the GDE.  
Just change your “Is Deleted?” column to an IF-THEN-ELSE

If Now() \> Timestamp  
Then true  
Else false

(you might need some additional logic to cover the case where the timestamp is empty)

---

<div class="post-metadata">

### Author: ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)
#### Post date: [January 21, 2021, 2:50am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/34 "2021-01-21T02:50:25Z")

</div>

Ok gotcha. So instead of a Gsheet, I could just use Glide Table then?

…I’ve never really delved too deep into Glide Tables, yet.

---

<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: [January 21, 2021, 3:15am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/35 "2021-01-21T03:15:53Z")

</div>

No, I wasn’t suggesting a Glide table.  
I was just suggesting doing that date checking logic in Glide, rather than using a script.

Here is an example of what I mean:

 ![Screen Shot 2021-01-21 at 11.11.42 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/6/5627214f266b4abc6f0f576d16cde55dad5cd87d.png)

The 4th column in the above example is an ITE column that returns true if Check Out is on or after Now.  
Of course, because that is a calculated column it won’t appear in your Google sheet (so you can’t use a script to do a hard delete), but you can use it to hide those “deleted” rows from view.

---

<div class="post-metadata">

### Author: ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)
#### Post date: [January 21, 2021, 3:24am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/36 "2021-01-21T03:24:00Z")

</div>

Oh yeah - I’m currently doing this (visibility settings for instant results for User).

I just meant if it was possible, using a script to delete rows in the gsheet, using a trigger that checks to see if =NOW() is -after- Timestamp (say it’s posted to Col 2), so as to limit number of rows used.

\*Thanks for the replies, by the way!

---

<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: [January 21, 2021, 3:42am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/37 "2021-01-21T03:42:30Z")

</div>

Yes, it’s possible. Here is a modified version of my earlier script that will do that.

```
function remove_deleted_rows_older_than_now(sheet) {
  var rows = sheet.getLastRow();
  var now = new Date().getTime();
  for (var row = rows; row >= 2; row--) {
    var checkval = sheet.getRange(row, 2).getValue();
    if (checkval != '') {
      var rectime = new Date(checkval).getTime();
      if (now > rectime) {
        sheet.deleteRow(row);
      }
    }
  }
}

```

It expects the timestamps to be in column 2, and will ignore any that are empty.  
_Please note:_ I haven’t fully tested that (I don’t have time right now), so please use with caution.

---

<div class="post-metadata">

### Author: ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)
#### Post date: [January 21, 2021, 3:47am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/38 "2021-01-21T03:47:41Z")

</div>

Ok thanks this is great! I’ll try it out in a test app first then haha

This was so deterring today so I really appreciate the help. 🙏🏻

---

<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: [January 25, 2021, 4:43am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/39 "2021-01-25T04:43:04Z")

</div>

Just now chiming in on this thread. **100% need a “Delete Row” action**.

Vote here:

> **[Feature Requests](https://features.staging.glideapp.io/dl/ewAiAHQAIgA6ADMALAAiAHMAIgA6ACIAYwBsAGEAcwBzAC0ARgBlAGEAdAB1AHIAZQBzACIALAAiAHIAIgA6ACIAbwBKAFkALgBUAFQAeABKAFIAeQBpAEEAMQBjAE8ASwBGAHAAZwBWAHcAQQAiACwAIgBuACIAOgAiAEQAZQBsAGUAdABlACAAUgBvAHcAIABhAGMAdABpAG8AbgAiAH0A)**
>
> Feature requests for Glide Apps

Visibility conditions to “archive” rows work (and are a REALLY useful feature when you need to preserve relations/rollups of previously entered information), BUT these rows still count against your row quota.

Likewise, clearing all columns via a Set Column action doesn’t quite work, because these phantom rows, even when using a Glide Table, count against your Row Quota. For instance, in the image below, the two selected rows were cleared using set column, but these two rows are still included in my number of used rows.

 ![Screen Shot 2021-01-24 at 11.32.38 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/f/bfcaacbfac62e21d7937ac92decb31d3f9c059ec.png)

The way I see it, the only way to delete rows is via script or integromat, BUT you end up sacrificing UX with the lag time.

### A “Delete Row” action would be the best solution by far.

This functionality _ **already exists** _ via the “Edit \> Allow users to delete” screen (which DOES allow you to earn back rows to your quota!), so all we’d need is an action to trigger that delete action.

Please and thank you!

@mark @david

---

<div class="post-metadata">

### Author: ![Rosewebstudio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rosewebstudio/32/12261_2.png) [@Rosewebstudio](https://community.glideapps.com/u/Rosewebstudio)
#### Post date: [January 25, 2021, 6:21am UTC](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390/40 "2021-01-25T06:21:59Z")

</div>

**Voted** @Robert_Petitto

[Previous page](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390.md?page=1)

[Next page](https://community.glideapps.com/t/delete-row-for-create-new-action-workflows/21390.md?page=3)
