I have 2 types of users in my app and I need to generate a unique username ( code ) for them which includes letters and numbers. and these are not random at all.
is there any tool that I can use or not?
if there is, can it make the code by other data provided by the users automatically?
Maybe “set a thing’s slug” can help. If slug already exists it will add “-1”, “-2”… at the end so it will be unique.
thanks for your reply,
my problem is I need to assign a very specific id to each person, for example:
user 1: W1706BUBUS
W as a website. 1706 date of registration, BUB is the name of the website( buuble.io), US the country
Keep in mind i ask for all these info on the app and i was wondering if there is any way of doing it automatically here
Why don’t you use bubble’s Built in UUID?
Every thing comes with a UUID, and it’s unique to your app. No matter what. You don’t have to worry about adding your own, and you don’t have to worry about generating one that already exists, bubble does that for you.
Current user’s unique ID
Current thing’s unique ID
The other way would be generating a nano ID string, and then relaying that back to your DB to see if it already exists, then assign to the thing. It’s just more of a process that may be a little extra.
Another note, like @aniv had said, you can use the SLUG property, which can only be a unique field, if one already exists, it’ll append “-1” to it.