# Auto increment index

**URL:** <https://community.glideapps.com/t/auto-increment-index/75177>\
**Category:** Ask for Help\
**Created:** [July 26, 2024, 6:02am UTC](https://community.glideapps.com/t/auto-increment-index/75177 "2024-07-26T06:02:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammaddiyor\_Sotvol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/muhammaddiyor_sotvol/32/77541_2.png) [@Muhammaddiyor\_Sotvol](https://community.glideapps.com/u/Muhammaddiyor_Sotvol)\
**Post date:** [July 26, 2024, 6:02am UTC](https://community.glideapps.com/t/auto-increment-index/75177/1 "2024-07-26T06:02:25Z")

</div>

I need to make a customized unique code for each object. For that I need an index. Index is incremented each time new item is created, but it should start from zero again in the next year. And process should happen over and over

Can u anyone tell me how to do it? Thank u

---

<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:** [July 26, 2024, 6:38am UTC](https://community.glideapps.com/t/auto-increment-index/75177/2 "2024-07-26T06:38:04Z")

</div>

> [@How do I create an auto-incrementing row number with Glide Tables?](https://community.glideapps.com/t/how-do-i-create-an-auto-incrementing-row-number-with-glide-tables/39572):
>
> This is a question that comes up a lot, so creating this topic to use as a reference. Typically, there are two distinct use cases when it comes to auto-incrementing row numbers. Use Case 1: – We need to generate a Part Number, or an Order Number, or an Employee ID. Once the number is generated, it should never change, even if rows are deleted. – The general approach for this use case is to maintain a static counter, use it to craft a suitably formatted ID, and increment it by one every time…

---

<div class="post-metadata">

**Author:** ![Muhammaddiyor\_Sotvol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/muhammaddiyor_sotvol/32/77541_2.png) [@Muhammaddiyor\_Sotvol](https://community.glideapps.com/u/Muhammaddiyor_Sotvol)\
**Post date:** [July 29, 2024, 5:23am UTC](https://community.glideapps.com/t/auto-increment-index/75177/3 "2024-07-29T05:23:33Z")

</div>

Sounds helpful, I think it helps. Thank u very much.But I am particularly struggling with index that starts from 0 every next year. Can u help me with it too?

---

<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:** [July 29, 2024, 11:30am UTC](https://community.glideapps.com/t/auto-increment-index/75177/4 "2024-07-29T11:30:44Z")

</div>

Which numbering method are you using?

---

<div class="post-metadata">

**Author:** ![Muhammaddiyor\_Sotvol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/muhammaddiyor_sotvol/32/77541_2.png) [@Muhammaddiyor\_Sotvol](https://community.glideapps.com/u/Muhammaddiyor_Sotvol)\
**Post date:** [July 30, 2024, 3:00am UTC](https://community.glideapps.com/t/auto-increment-index/75177/5 "2024-07-30T03:00:23Z")

</div>

First, in a separate column, I gathered all row ids using look up. Then, I found index of each row id in row ids array I got using look up. But I think this is not effective method since literally a lot of row ids will be continuously saved

---

<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:** [July 30, 2024, 3:28am UTC](https://community.glideapps.com/t/auto-increment-index/75177/6 "2024-07-30T03:28:30Z")

</div>

That method shouldn’t be a problem. It’s all computed columns. It’s not saving anything anywhere.

To have the number start over with zero each year (assuming you already have a column with the year), you just need to add a relation column linking the year column to itself. Then change to Lookup column to use the relation instead of the table.

---

<div class="post-metadata">

**Author:** ![Muhammaddiyor\_Sotvol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/muhammaddiyor_sotvol/32/77541_2.png) [@Muhammaddiyor\_Sotvol](https://community.glideapps.com/u/Muhammaddiyor_Sotvol)\
**Post date:** [July 30, 2024, 3:55am UTC](https://community.glideapps.com/t/auto-increment-index/75177/7 "2024-07-30T03:55:35Z")

</div>

i am actually quite new to all this, and I am having hard time understanding what u mean by:

> [@Jeff\_Hager](#):
>
> Then change to Lookup column to use the relation instead of the table

Can u plz elaborate, thank u

---

<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:** [July 30, 2024, 4:19am UTC](https://community.glideapps.com/t/auto-increment-index/75177/8 "2024-07-30T04:19:39Z")

</div>

When you set up a lookup column, you can choose between tables and relations. Be sure to choose the relation. It sounds like you already have a lookup column, but you just need to make a small change to it to use the relation instead of a table.

 ![Screenshot_20240729-231701](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/d/dde890265cfe0a5813595a9a8eb2234b71241a46.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [August 6, 2024, 4:20am UTC](https://community.glideapps.com/t/auto-increment-index/75177/9 "2024-08-06T04:20:19Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
