# Add new row "below" current row

**URL:** https://community.glideapps.com/t/add-new-row-below-current-row/36036
**Category:** Ask for Help
**Created:** [December 16, 2021, 9:21pm UTC](https://community.glideapps.com/t/add-new-row-below-current-row/36036 "2021-12-16T21:21:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![djudes](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@djudes](https://community.glideapps.com/u/djudes)
#### Post date: [December 16, 2021, 9:21pm UTC](https://community.glideapps.com/t/add-new-row-below-current-row/36036/1 "2021-12-16T21:21:54Z")

</div>

Is there a way to use the action “Add Row” but instead of adding it to the botton of the sheet, it adds it right under my current row.

I have a list of 100 items to purchase. I select item in row 49, input purchased quantity. If quantity \< 25, add new row with same info, add new row, just under previous one, at position 50.

I can use Zaps if needed, but havent found anything so far.

---

<div class="post-metadata">

### Author: ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)
#### Post date: [December 16, 2021, 11:56pm UTC](https://community.glideapps.com/t/add-new-row-below-current-row/36036/2 "2021-12-16T23:56:21Z")

</div>

Add row always adds to the bottom of the sheet.  
Couldn’t you just use a sort order to show all rows depending on your criteria?

---

<div class="post-metadata">

### Author: ![djudes](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@djudes](https://community.glideapps.com/u/djudes)
#### Post date: [December 16, 2021, 11:58pm UTC](https://community.glideapps.com/t/add-new-row-below-current-row/36036/3 "2021-12-16T23:58:49Z")

</div>

Thanks for replying Roldy.

It’s mostly for the “supervisor” using Google Sheets. Having it at the bottom is unconvenient for them and adds a manual step. Since we can’t have a mix of Pages and Apps, I decided to use App but my admin work stills needs to be done through Google Sheets. ☹

---

<div class="post-metadata">

### Author: ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)
#### Post date: [December 17, 2021, 12:13am UTC](https://community.glideapps.com/t/add-new-row-below-current-row/36036/4 "2021-12-17T00:13:07Z")

</div>

I understand. So if this is the specific case, I think that using google sheet you have to find a solution in google sheet.  
I would write a function in apps script that puts the rows back in order in another sheet.  
I don’t think there is another easier way.

---

<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: [December 17, 2021, 12:14am UTC](https://community.glideapps.com/t/add-new-row-below-current-row/36036/5 "2021-12-17T00:14:36Z")

</div>

As you said, the API always write to the last row, so it might have to be script here.

- Find the number of the “current row”.
- Get all the data that is below the “current row”.
- Shifts that data one row below so we have an empty row.
- Write the new data to the empty row.

However, this can become quite a mess if multiple people try to do it at once.

---

<div class="post-metadata">

### Author: ![djudes](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@djudes](https://community.glideapps.com/u/djudes)
#### Post date: [December 17, 2021, 12:58am UTC](https://community.glideapps.com/t/add-new-row-below-current-row/36036/6 "2021-12-17T00:58:20Z")

</div>

Thanks to both of you for the suggestion!
