For every user in my user-profile table i want the user to be associated with a “short” 6-8 character unique code ( read as affiliate ID ) which can be used by new users as referral.
a. I initially thought of using the unique username the user registers with to be used for this purpose but i do give an option for the user to change the username in future so this fails
b. i tried to see if the UniqueID generator can be used but this is a very long string and i want something short of 6-8 chars max ( alpha-numeric )
c. Tried to use randbetween function and then wrapping it up with DEC2HEX to generate the string. But i need to to this to a field/cell only when a new user registers and it should remain static once generated for a given user - Struggling with it ( got a GSheets script too which generates this code)
But wondering how to populate this value only when a new user is registered - all the IF , IFBLANK, kind of conditions in sheets are not going though the way i want.
Apparently Glide doesnt have an option of generating random string with length as constraint
The amount of search i have done and not yeilded results mean that there might be a simpler way of doing which am not able to figure out in this struggle.
Anyone can help ?