# \[Showcase\] Concurrent Auto Row Number preserving increment even with deletion of past rows. GS Apps Script + RowID

**URL:** <https://community.glideapps.com/t/showcase-concurrent-auto-row-number-preserving-increment-even-with-deletion-of-past-rows-gs-apps-script-rowid/31361>\
**Category:** Ask for Help\
**Tags:** custom-code\
**Created:** [September 4, 2021, 9:18am UTC](https://community.glideapps.com/t/showcase-concurrent-auto-row-number-preserving-increment-even-with-deletion-of-past-rows-gs-apps-script-rowid/31361 "2021-09-04T09:18:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxim\_KM](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maxim_km/32/29274_2.png) [@Maxim\_KM](https://community.glideapps.com/u/Maxim_KM)\
**Post date:** [September 4, 2021, 9:18am UTC](https://community.glideapps.com/t/showcase-concurrent-auto-row-number-preserving-increment-even-with-deletion-of-past-rows-gs-apps-script-rowid/31361/1 "2021-09-04T09:18:21Z")

</div>

Hi guys, for my needs I’ve developed assigning of Row Number based on Row ID.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/a/3afc0b89c2bb26a1a1983c90375835b2559f5a46.png)

**Approach**  
GS Apps Script onChange trigger that reacts to new rows without Row Number and assigns auto-incremented numbers in a locked environment(concurrent creation at the same time solved).

🔒Row ID is optionally used as the key for assigned Row Numbers. Therefore, if row is restored - the previously assigned Row Number will be used again.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/c/3cc50976d91d6263de233392a6293b7ec0068754.png)

**Caveat**  
As with any GS modification - it takes time to be synced by Glide. I use update action to sync it faster(but anyway number syncs from immediately to 10-20 seconds)

**If it’s interesting to the community - I’ll prepare reusable example and instructions.**

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [October 5, 2021, 2:13pm UTC](https://community.glideapps.com/t/showcase-concurrent-auto-row-number-preserving-increment-even-with-deletion-of-past-rows-gs-apps-script-rowid/31361/2 "2021-10-05T14:13:32Z")

</div>

Yes, interesting. Please post example. Thank you
