Unique Numbers

Hi everyone, I’m going crazy. :frowning: I would like to have a row that creates a unique and consecutive number every time a new row is created. When a row is deleted, however, the rows below should not slip, the number should always be connected to the row. We need it for storing wheels. If a wheelset with warehouse number 23, for example, is no longer available, this number is gone forever, if a new wheelset is stored, this wheelset is automatically given a new number, but 23 is gone.

Good morning @Waser_I_Solutions

I don’t think you’ll be able to achieve unique row numbers in a Glide Table, however this should doable in a Google Sheet.

You could upvote the following feature request :slight_smile:

simply have a starting number somewhere, and every time you add an item (row) write that number to this row and increment starting number by 1… that’s all.

I can start with 1, and it should simply add +1 from the cell above, that means if I have a series like 1,2,3,4,5 and now delete the product 4, for example, then the other values ​​should be added neither slide nor should they change, the 4 is then gone forever. when i create a new product it gives me a value from the cell above, i.e. 5 and then +1 off, i.e. 6, that is the idea

There are several different ways to approach this. Here is one approach that I’ve used just in the past few days:

  • Start by manually assigning all existing records an ID (let’s say that’s 1 to 500)
  • Take the next number in the sequence (501), and store that in a Numerical column somewhere
  • Each time a new “Wheel” is created, take the stored value in the numerical column above and use that as the “Wheel ID”
  • Then Increment the stored value by 1 (501->502), so that it’s ready for the next row that is created

The above option works well, but can fall down in high volume scenarios. That is, if two users happen to be creating a new Wheel at the same time, then it’s possible that both Wheels could end up with the same ID. But if Wheels are only added infrequently, it should be fine.

For high volume situations where many users could be creating records concurrently, the only way that I’m aware to handle it is to use something external to Glide to assign the ID’s. Integromat, for example.

5 Likes

Hello, I don’t understand how to implement it in glide, could you explain it to me in more detail? I want to generate a number every time a new set of tires is added through a native form (a new row), if the row is deleted, then the number should also be deleted. It’s easy in google sheet, but the other numbers keep sliding up so that they no longer belong together with the unique article

Here you go…


If the above video won't play, copy and paste the below link into a browser
https://www.loom.com/share/58bb8a0bc8294fd9b03ca68467e924ed
9 Likes

Wow thank you Darren how can I thank you. I’ve been on it for almost a week and your video rocks. Thank you.

1 Like

No problem, but do keep in mind what I said earlier…

this app is for a garage operator and he only has one user, and if he operates the app on his cell phone and pc at the same time, that’s the only moment when things could get tight, right?

yeah, that should be no problem at all. If there is only one user, he’d have to try really hard to get two created with the same ID.

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