# Unique Username Check

**URL:** <https://forum.bubble.io/t/unique-username-check/111238>\
**Category:** Database\
**Created:** [September 13, 2020, 3:58am UTC](https://forum.bubble.io/t/unique-username-check/111238 "2020-09-13T03:58:53Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![samhouston1107](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@samhouston1107](https://forum.bubble.io/u/samhouston1107)\
**Post date:** [September 13, 2020, 3:58am UTC](https://forum.bubble.io/t/unique-username-check/111238/1 "2020-09-13T03:58:53Z")

</div>

Hello,

On my signup form I’m trying to make sure the user is entering a unique username.

I’ve been trying to figure it out with no success.

 ![Screen Shot 2020-09-12 at 11.56.14 PM](https://us1.discourse-cdn.com/bubble/original/3X/3/6/36f127bed269aa1b184872d41433ce995f839f16.png)

---

<div class="post-metadata">

**Author:** ![samhouston1107](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@samhouston1107](https://forum.bubble.io/u/samhouston1107)\
**Post date:** [September 13, 2020, 4:19am UTC](https://forum.bubble.io/t/unique-username-check/111238/2 "2020-09-13T04:19:48Z")

</div>

![Screen Shot 2020-09-13 at 12.15.06 AM](https://us1.discourse-cdn.com/bubble/original/3X/2/b/2b2f2710c5548b4e7b40fd6ba1dc6ef730d8d94d.png)

 ![Screen Shot 2020-09-13 at 12.19.26 AM](https://us1.discourse-cdn.com/bubble/original/3X/e/1/e1df491575e6435271f318480edde4faa6dc459e.png)

---

<div class="post-metadata">

**Author:** ![batuhanmerguz](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/batuhanmerguz/32/255886_2.png) [@batuhanmerguz](https://forum.bubble.io/u/batuhanmerguz)\
**Post date:** [September 13, 2020, 8:38am UTC](https://forum.bubble.io/t/unique-username-check/111238/3 "2020-09-13T08:38:04Z")

</div>

Hi, @samhouston1107 I think this condition will solve your problem. ![username](https://us1.discourse-cdn.com/bubble/original/3X/a/4/a43a03eff5166d80ba33f3b0b8832694597cbaf8.png) ![works](https://us1.discourse-cdn.com/bubble/original/3X/1/6/168d0e3c0f432df3c5599e32c437af0d71edaeb3.png) ![help](https://us1.discourse-cdn.com/bubble/original/3X/7/3/73aff61775e05443e8a89e65b4a21aaedb77d3ef.png)

---

<div class="post-metadata">

**Author:** ![ambroisedlg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ambroisedlg/32/61966_2.png) [@ambroisedlg](https://forum.bubble.io/u/ambroisedlg)\
**Post date:** [September 13, 2020, 8:46am UTC](https://forum.bubble.io/t/unique-username-check/111238/4 "2020-09-13T08:46:24Z")

</div>

Hey @samhouston1107

The way I did it:

 ![unique-username](https://us1.discourse-cdn.com/bubble/original/3X/1/6/164e75c9968218967c73a4c6a3cf944e352eef07.png)

Works fine on my end!  
Ambroise

> **Need extra help?**
>
> [Book a free 15 minutes call](https://ambroisedlg.bubbleapps.io) - happy to help if I can

---

<div class="post-metadata">

**Author:** ![samhouston1107](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@samhouston1107](https://forum.bubble.io/u/samhouston1107)\
**Post date:** [September 13, 2020, 4:48pm UTC](https://forum.bubble.io/t/unique-username-check/111238/5 "2020-09-13T16:48:47Z")

</div>

This is for my signup form. I don’t want the user to gain access within the application if the username is already in use. I also need to send feedback to the user letting them know why they can not login. Example [Username is already in use].

---

<div class="post-metadata">

**Author:** ![samhouston1107](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@samhouston1107](https://forum.bubble.io/u/samhouston1107)\
**Post date:** [September 13, 2020, 4:49pm UTC](https://forum.bubble.io/t/unique-username-check/111238/6 "2020-09-13T16:49:11Z")

</div>

This didn’t work for me also.

---

<div class="post-metadata">

**Author:** ![ambroisedlg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ambroisedlg/32/61966_2.png) [@ambroisedlg](https://forum.bubble.io/u/ambroisedlg)\
**Post date:** [September 13, 2020, 4:53pm UTC](https://forum.bubble.io/t/unique-username-check/111238/7 "2020-09-13T16:53:35Z")

</div>

@samhouston1107

Not sure why it’s not working on your end, but the logic is pretty basic.  
The Search for Users:count \> 0 basically looks in the database if there is at least 1 user with the username informed in the input field. If there is, the ‘Signup’ button is not clickable. From my understanding it should fit your use case right?

Ambroise

> **Need extra help?**
>
> [Book a free 15 minutes call](https://ambroisedlg.bubbleapps.io) - happy to help if I can

---

<div class="post-metadata">

**Author:** ![batuhanmerguz](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/batuhanmerguz/32/255886_2.png) [@batuhanmerguz](https://forum.bubble.io/u/batuhanmerguz)\
**Post date:** [September 13, 2020, 5:05pm UTC](https://forum.bubble.io/t/unique-username-check/111238/8 "2020-09-13T17:05:47Z")

</div>

This condition should do the job for you. I’ve tried this on my login page, and it works. You can add custom properties to send feedback, for example, I used the font color feature.

---

<div class="post-metadata">

**Author:** ![ambroisedlg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ambroisedlg/32/61966_2.png) [@ambroisedlg](https://forum.bubble.io/u/ambroisedlg)\
**Post date:** [September 13, 2020, 5:08pm UTC](https://forum.bubble.io/t/unique-username-check/111238/9 "2020-09-13T17:08:39Z")

</div>

Hey @batuhanmerguz

I agree that it should work, however the ‘contains’ function is not best practice for that particular use case.  
It would mean that if a user’s username is ‘test’, then other users wouldn’t be able to choose ‘test123’ as a username, even though it would be unique in the DB.

Cheers  
Ambroise

> **Need extra help?**
>
> [Book a free 15 minutes call](https://ambroisedlg.bubbleapps.io) - happy to help if I can

---

<div class="post-metadata">

**Author:** ![batuhanmerguz](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/batuhanmerguz/32/255886_2.png) [@batuhanmerguz](https://forum.bubble.io/u/batuhanmerguz)\
**Post date:** [September 13, 2020, 5:17pm UTC](https://forum.bubble.io/t/unique-username-check/111238/10 "2020-09-13T17:17:59Z")

</div>

Hi, @ambroisedlg

They changed the ‘contains’ function in this month’s updates now you can use it without hesitation.

Currently, if a user’s username is ‘user’, then other users can take user123, etc.

 ![contain](https://us1.discourse-cdn.com/bubble/original/3X/7/8/787f21577cdf90e8025b926032b0adcbb4fb8820.png)

---

<div class="post-metadata">

**Author:** ![ambroisedlg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ambroisedlg/32/61966_2.png) [@ambroisedlg](https://forum.bubble.io/u/ambroisedlg)\
**Post date:** [September 13, 2020, 5:20pm UTC](https://forum.bubble.io/t/unique-username-check/111238/11 "2020-09-13T17:20:21Z")

</div>

Right thanks @batuhanmerguz good to know! I actually saw that update but I think I’m still used to the previous ‘contains’ function

Ambroise

> **Need extra help?**
>
> [Book a free 15 minutes call](https://ambroisedlg.bubbleapps.io) - happy to help if I can

---

<div class="post-metadata">

**Author:** ![samhouston1107](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@samhouston1107](https://forum.bubble.io/u/samhouston1107)\
**Post date:** [September 13, 2020, 5:43pm UTC](https://forum.bubble.io/t/unique-username-check/111238/12 "2020-09-13T17:43:48Z")

</div>

![Screen Shot 2020-09-13 at 12.34.46 PM](https://us1.discourse-cdn.com/bubble/original/3X/7/7/77c34da8d25a69877f063cd8d0ca86c93ac2cf36.png)

I tired this way

 ![Screen Shot 2020-09-13 at 12.31.33 PM](https://us1.discourse-cdn.com/bubble/original/3X/2/1/216df2c72053c51d2f48699566bfe7b68f41d58e.png)

And I tired this way. @ambroisedlg I booked a session with you for Monday also. I’m sure I’ll need your help throughout my MVP development.

![Screen Shot 2020-09-13 at 12.34.10 PM](https://us1.discourse-cdn.com/bubble/original/3X/6/3/637a078fd5b770356e804513b5506fca488fc047.png)

---

<div class="post-metadata">

**Author:** ![ambroisedlg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ambroisedlg/32/61966_2.png) [@ambroisedlg](https://forum.bubble.io/u/ambroisedlg)\
**Post date:** [September 13, 2020, 5:46pm UTC](https://forum.bubble.io/t/unique-username-check/111238/13 "2020-09-13T17:46:57Z")

</div>

@samhouston1107

> [@samhouston1107](#):
>
> ![Screen Shot 2020-09-13 at 12.31.33 PM](https://us1.discourse-cdn.com/bubble/original/3X/2/1/216df2c72053c51d2f48699566bfe7b68f41d58e.png)
> 
> Screen Shot 2020-09-13 at 12.31.33 PM1436×980 104 KB

Try replacing the Username = Username’s value by Username = Username Input’s value

> [@samhouston1107](#):
>
> ![Screen Shot 2020-09-13 at 12.34.46 PM](https://us1.discourse-cdn.com/bubble/original/3X/7/7/77c34da8d25a69877f063cd8d0ca86c93ac2cf36.png)
> 
> Screen Shot 2020-09-13 at 12.34.46 PM752×1120 62.6 KB

Also, you should not put the condition on the input itself, you should put it on the ‘Signup’ button so that’s it’s not clickable when the Username is not unique

> [@samhouston1107](#):
>
> And I tired this way. @ambroisedlg I booked a session with you for Monday also. I’m sure I’ll need your help throughout my MVP development.

Awesome looking forward to meeting you tomorrow!

Ambroise

> **Need extra help?**
>
> [Book a free 15 minutes call](https://ambroisedlg.bubbleapps.io) - happy to help if I can

---

<div class="post-metadata">

**Author:** ![Timmy](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@Timmy](https://forum.bubble.io/u/Timmy)\
**Post date:** [January 4, 2021, 9:06pm UTC](https://forum.bubble.io/t/unique-username-check/111238/14 "2021-01-04T21:06:27Z")

</div>

Hello all,

@samhouston1107

To make it unique you’ll need to take into account multicase too. When I save to db I save in lowercase and trim the value. Then in the search constraint convert to lowercase and trim the search value.

 ![Screenshot 2021-01-04 at 20.52.02](https://us1.discourse-cdn.com/bubble/original/3X/0/2/028955e9dafd5854fda0d7c93faae119e99b0f8e.png)

Hope this helps .

---

<div class="post-metadata">

**Author:** ![9631768](https://avatars.discourse-cdn.com/v4/letter/9/c37758/32.png) [@9631768](https://forum.bubble.io/u/9631768)\
**Post date:** [September 18, 2024, 12:10pm UTC](https://forum.bubble.io/t/unique-username-check/111238/15 "2024-09-18T12:10:56Z")

</div>

Is there any way to make it not to be case sensitive (for exsample: when there is a username ‘hello’ can I block a user from getting the name ‘Hello’ or ‘HELLO’)
