Hi. I’ve set up my app so that the username is set as the slug. However it formats the slug with dashes between words and numbers. Ex: First-Name-123 instead of firstname123 or more preferably, FirstName123.
How can I fix this? Ideally, I’d love a workflow that checks for unique usernames and prevents spaces as the user is entering theirs, instead of a slug assigning a number at the end. But this seems very complicated in bubble.
Bubble slugs cannot contain uppercase letters. You can look into creating a path segment instead of using slugs but this requires quite a bit of extra work to handle correctly and it might not be worth your time.
In general, you can use the :find and replace operator when setting the user’s slug, and replace spaces in your users name with nothing (literally leave the replace box blank)
If you want to stop users from using spaces in their username, you can check for spaces in a conditional or use this plugin to replace spaces with empty characters as they are being typed.
Thanks. It’s not working, but I’m also not sure if I set it up right. (The instructions for this plug in are terrible and there is no documentation or demo). Here’s how I currently have it set up:
ID attributes cannot have spaces in them. And for the ‘New Character’ input use the operator ‘Arbitrary Text’ but keep the arbitrary text empty. From what i remember the input expects a value, so using an empty arbitrary text gets around that.
But yes, as @chris.williamson1996 says, using lowercase and find&replace can be a more straightforward solution.
The plugins is to actually disable spaces on the input, but you could just use a conditional to check whether there are spaces in the input field and put a notice for the user that they cannot use spaces in their username. There are many ways to do it.
I like the idea of getting the plug in to work because then I can set it as the user’s slug very easily. Unfortunately, it is still not working. @ZeroqodeSupport
Update: I got it to work and create unique usernames with a million conditionals and hidden elements.
Repeated the same in a user account settings page so the user can change their username too. I’m surprised bubble doesn’t have a built in feature for unique user names + using usernames as slugs.