Unique Username

I have an app where in people log in through their FB account. From the login page they are taken to the page where they are required to form a username . I want to ensure that each and every user has a unique username. And if someone enters an existing username there should be a popup saying username exist. Please Help

1 Like

You need to create a username list in your database. When the user enters a username, you would check if that name is on the list already. If it is, you return an error. If it is not, you would let them proceed and then add it to the list.

4 Likes

Can you explain a little further as I am new to bubble. How does the database work and should I create a list for username. Please help

I do it this way

Well, Raymond can you explain this whole thing. I am new to bubble and it’s pretty difficult for me to understand how things work here.

Sure. Here is another example that I’m using in a business directory for a client.

“This company already exists” is a text element that is not visible on page load & shows when a condition is mete

This is the condition

and this is in the workflow for the save button

Play around with a few ideas, make a few mistakes and try until you get it right. That way you will remember it next time.

Hope this helps

so in your example “Companys” is a list ? And what is “Companys’s Registered Name” ?
And why are we saying that count>0 ?

Company is a type (data table) in the data base.
Registered name is the legally registered name of the company and a it is a text field within the Company data base.

We are saying the count >0 so that the text field will show hen the count is bigger than 0. I.o.w. the text field field will show to give a warning to the user

On the button we do the condition so that it will not save the data if it is not unique.

I did an example in the forum app for you Forum_app2 | Bubble Editor

It’s a basic example. There is a lot that can be added on to this

Well, I have made the changes in the text that display when already registered company is saved again. But can you please help me with the workflow of the save button because I have already some workflow going on with my save button. Plus if you could provide a screenshot of the workflow of the save button as it’s not clear in the above picture

I deliberately took the screenshot like that. My client won’t allow me to show the workflows in detail.
What do you want to know?

oh… Well as of now my Create Username button let a new user save his username. Now I want to know how should I ensure that when he presses the Create Account button then button should ensure that the entered username is unique else won’t let the user move forward.

That’s where the condition comes in on the button screenshot. If the username exists it won’t save the data

Raymond things are working now. But I have a small error. As you have posted the picture where the Text message is showed using a certain condition. I just can’t get it right. Please help

Can’t understand where I am I wrong.

I mean how did you make the text element hidden ?

When <input’s value>
IS NOT IN
This element is visible should be false/unchecked

Is this what you are saying? I still can’t get it done

here is my app in editor. Please have a look and let me know the neccessary changes to be made

I’m not going to tell you exactly how to do it, else you won’t learn how to do it next time! I think it’s more effective to share the concepts and point you in the right direction so you can accomplish it yourself. Bubble is a very logical tool, in that it can help to think of things one step at a time. In your example, this is what that story looks like: “When a user types in a username, I want to check if that name is in a list of all my usernames. This means I need to create a list where every username is stored. Then, if the user’s input is already in that list, I want to show an error text.”

Bubble allows for every bit of what you’re looking to do. I would recommend going through the tutorials to get the foundations of building conditions and workflows, it seems you’re missing some of the groundwork here.

3 Likes

well, I have done the rest of the work the only thing left here is to display the error message. Infact the error message is also working fine. it’s just that the error message stays there from the start. I just want to know how to make the text element a hidden element. Please Help

The checkbox that says “this element is visible on page load”

2 Likes