Generate registration ID

Hi, I want to generate a unique registration ID after submitting details like name address etc. It can be serial number. Existing UID doesn’t solve the purpose since it is too long.
Pl help.

Can you say why it is too long?

Have you tried the Row ID column?

Is this unique registration ID something your users would need to see? Or is it something that is hidden for use elsewhere in your app?

User need to see the ID. It will be written on Icard after registration
It would be preferably 6 digit number

Row ID is a 36 digit number, which may be useful for internal purposes but I need a 5 to 6 digit number, which will be generated every time a new user’s data submitted
@mark Pl help

I use an arrayformula which uses the row number in my sheet to create a “unique ID”.

=arrayformula(if(row($A1:$A)=1,“Customer ID”,if(len($A1:$A)>0,text(row($A1:$A)-1,“C00000”),"")))

The ID is 6 digits long but it’s not a perfect solution. If a record were to move to another row for whatever reason, it’s ID would change.

It’ll work for when my app is small, but i know i will encounter problems when I start thinking about archiving.

Hope this helps, and if anyone has a suggestions on how to improve on this I’m all ears!

1 Like

Here is another solution:

If you are already using the Unique Identifier column in Glide, create a new column in your sheet, name something like: “GenerateRefID”.

Then write this formula into the first row of that new column:
={“GenerateRefID”;arrayformula(if(len(b2:b)=0,right(b2:b,6)))}

Here is a copy of an app I made for reference so you can how the formula works with Glide. You can also take a look at the sheet data to see the formula written out.

GenerateIDs.glideapp.io

Hope this helps.

1 Like

I use a simple arrayformula

=ARRAYFORMULA((IF(LEN(G2:G) = 0, “”,ROUND(G2:G/7^5+5*SECOND(B2:B)))))

G2:G is an array containing user phone numbers (no spaces or dashes)
(IF(LEN(G2:G) = 0, “”, — just prevents the arrayformula from filling empty rows.
ROUND(G2:G/7^5+5*SECOND(B2:B)))) ---- Performs some arbitrary math on the phone number (G), divided by 7 to the power of 5+5 multiplied by the the SECONDs value of the timestamp (B). This delivers a unique 6 digit ID, which is mostly reliable, chance of duplicate IDs isn’t 0 but it’s functional.

You can use any method of getting a number from your user input, like the LEN of an email address, and display it back to the user.

1 Like

Thank you all for your kind input. I have already used the formula using ROW() but along with that used REPT function so that it gives as ID like PS0006 etc. This is not 100% full proof. If some data is deleted from sheer and someone deletes that row then all the ID will be recalculated.
Any way thanks. Hope Glide team will look into it.

1 Like

The only other thought would be some sort of script to auto populate an ID the way you want.

1 Like

I have actually stopped using the random number scramble and now use Glide’s auto row-ID, eg. SUvqDX+PQrGCoSmgu+NGZg it’s probably the most secure way to get a unique ID.

1 Like