How do I create an auto-incrementing row number with Glide Tables?

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 a new row is added.
    – The following video walks through that step by step:

If the above video won’t play, paste the following into a browser:

https://www.loom.com/share/58bb8a0bc8294fd9b03ca68467e924ed?sid=2e96e0b1-d1ff-42f0-bfd2-dd4926af953d
  • Use Case 2:
    – For the second use case, we want a dynamic row number that will automatically change as new rows are added/removed.
    – The solution for this use case is very simple, and takes advantage of one of the new Array Plugin columns. Credit to @11183 for first describing the approach.
    – The following video shows how to do it:

If the above video won’t play, paste the following into a browser:

https://www.loom.com/share/13166419c13d4e44b961d01be5f2f801?sid=5f479f3d-92e9-4397-92cc-0df0b34f2cd4

42 Likes
Create an Auto ID when adding a new student
Auto Increment
How to generate unique no while adding new records
ROW IDs ! Urgent issue with Glide
How do I automatically name the sku in a increases
Best Practice for creating a single value Role Column?
Forwarding inventory number
Trying to have a column add 1+1 in each row
Dados automatico
Pulling Unique elements from column into column in another table
Auto generating column values by "Set column Values" is not working
🎞️ 1. How to Create an Auto-Play Slideshow
Ranking and Data Storage
Unique Human Readable Reference
List Unique Dates in Rows
How to change the row order in Glide Table?
Trying to create an dynamic table
Dynamically duplicate x Rows in a table based on criteria
Multiple Image Gallery Card / Grid View
Fullproof autonumber with native Glide columns
Transpose and Split Data into new Sheet
Hello: I want to create a numerical sequence for an order number
Increment values in a column of data by 1
Create A To Do List (Milestone Task List)
Basic Question
How do you have a column index that can count from 1 to 100?
Generating shorter unique ID for every user
Deleting a specific table raw, next items get re-ordered numbers
Choice items from split text items
How to create index numbers in columns, autocomplete addresses Robert pettito
Add rows sequentially
Links Between Databases
Parent/Child Relationship
Integrating Glide App with Pipedrive CRM via AI Transcriptions
How to make running number and concatenate data?
Hello Glide Family, Generate SKU from user input
Sorry, i dont know how to tell the problems
New article number for created Product
How to add a column with auto numbering?
Configure "Go to next row" button
Next/Previous record/details screen buttons
Increment for all rows
Generating Order Numbers, Payments, and Email Templates
Transpose data from a column in one table to another table in a row
Record counter
How to Automate Number Generation (No Repetition)
How to reference a pervious row in a Math calculation
Is it possible to have a customer add their own choices?
Simple ROW ID
Simple ROW ID
Same Column in Different Tables
UNIQUE function in Glide
Fixing columns
Sequencial Number on New Form entry
Numero Consecutivo
Auto-incrementing field in Glide through a form
API call not able to read it
🎞️ 1. How to Create an Auto-Play Slideshow
Increment + GSheets
How to create a table with unique dates?
Auto increment index
Unique values to be added to new table
Building an Itinerary: Automating Date Increments in Glide
I want to create an automatic order number sequence column for an orders table
Array values as a choice for user
Does glide have auto increment id ?or number other than this one
Line numbering in the Custom Collection
Need help auto generating codes in sequence for pipeline number
"Edit screen" ne met pas à jour les ligne dans google sheets
Classroom Attendance App - Track Absentees
Random number
Using math column
Uploading an image for every day of the year
How to get a column with a number
Dans glide, enlever les lignes data ou les date sont dépassée
Display row markers in tables not just the data grid

Hi @Darren_Murphy , thanks for this F.A.Q.
About case 1, I use the same method but with a little variation:

  • instead of building the two template columns (one in staff, and one in lookup), in lookup I prefer to define a rowid column, retrieve its content in staff via a single value column, and then build a single relation between these two values.
    Could it be better from a performance standpoint, in your opinion?
1 Like

hey @Roldy

I’m not sure I could say whether one approach is better than the other. The end result is the same in both cases, because you need that single relation. It’s just a matter of how you get there. My guess would be that it probably doesn’t make much difference for this use case. I think your approach is fine :slight_smile:

2 Likes

Great explanations @Darren_Murphy ! Bookmarking these for future use!

Nice. Changing the category to “Tutorials” instead of Help.

Thanks for this! Will get referenced a lot, I’m sure.

1 Like

Used this method for an app that multiple user get access

But the number always get off, for example:

90
91
92
(blank)
23
54
55

the number doesnt consistently follow from the number we used to start the number

1 Like

Can you share details of how you implemented this?

If I was to make a wild guess, I’d say it sounds like you might be using some User Specific Columns where you shouldn’t be. But that is just… a wild guess

created another table (Table B)
in Table B

then at the original table
i create a relation to table B (Number) and call a single value out of it
relation from table A

So whenever a user create/add a entry, i call the single value , and auto increment the table B’s Number by 1

It looks like you have some sort of variation of the first option that I showed in my original post.

Is there any reason why you didn’t want to set it up in a similar way that’s shown in the video?

hmm, im sorry arent it the same ?
since i call a relation to the lookup value ?

or is it important to check the current user ?

btw, im still abit confused about the If Then Else function there ?
what does it do ?

In the example I showed in the video, the if-then-else column is used to determine if the EmployeeID needs to be zero-padded. You can probably ignore that.

No, it doesn’t look the same to me.

Using the signed in user ID is used in a template to create a relation between the two tables.
Actually, looking back at that now, it could be simplified quite a bit. Instead of using templates to create a relation, we could just use a Single Value → First → Whole Row to grab the whole first row from the Lookup table, and then use a Lookup through that Single Value to fetch the next ID, and also use it for the onSubmit increment action.

Make yourself a copy of the below App and use that as an example for your own - you might find it a bit simpler to understand.

1 Like

Ok Thanks for the explanation and the copy of the apps
cause since the beginning creating my own apps, im been stuck to that auto increment, already watch the video multiple time, but still dont get it. :melting_face:

hope this method wont show any blank or random number again

anyway can i ask about the number entry? im sorry if its not about this topic

while inputting a price number, is it possible to have a realtime comma separating thousand automatically ?

No, but if you format the column where the Number is being saved to include a group separator, then it will be inserted when the saved value is displayed.

Note: the separator used can vary, according to the Users device regional settings. ie. some regions use a period (.) instead of a comma

2 Likes

hello, did that method, but it still make error

Capture

input by multiple user with row owner set up

Obviously, something is wrong. But it’s really difficult for me to say what just by looking at a single screen shot. If you set it up the same as in the concept App, it will work, even with Row Owners applied. So if it’s not working for you, that means you must have done something different. In order to help you solve it, you need to help me understand what it is that you’ve done different.

2 Likes

Ola boa noite… nao estou consegiundo realizar este modelo como no video, sera que poderia me ajudar… ele gera o codigo porem inseri um monte de zero no final…

If you show me how you have set it up, I may be able to point out where the problem is.

BOM DIA TUDO BEM, SEGUE PRINTS DE COMO EU CONFIGUREI… SERA QUE SE EU TE DER ACESSO AO SISTEMA VC PODERIA VERIFICAR PARA MIM POR GENTILEZA?