# How to check the name repeated in firebase with thunkable x

**URL:** <https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463>\
**Category:** Questions about Thunkable X\
**Created:** [May 25, 2020, 4:40pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463 "2020-05-25T16:40:11Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronymarcosdci](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronymarcosdci/32/39424_2.png) [@ronymarcosdci](https://community.thunkable.com/u/ronymarcosdci)\
**Post date:** [May 25, 2020, 4:40pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/1 "2020-05-25T16:40:11Z")

</div>

I need to check if I already have a username repeated within my database and create a condition. however, I don’t know which complement I use to make such a process

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [May 25, 2020, 5:25pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/2 "2020-05-25T17:25:40Z")

</div>

Hi @ronymarcosdci,

You can list objects in Firebase. Might look something like this, though I don’t know exactly how your Firebase is laid out.

### Display Firebase objects as list:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/6/860c45b2a1365246e6fced49f3def3285c911ed5.png)

### Firebase example for these blocks:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/15d6241e569c038f692d1e430b6c971620d99e41.png)

### Creates this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/1/a1ba111187b57af6ce97c4f68eea8cbf3b7f220a.png)

### You can use an if statement like this to check if the username exist in the list:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/0/a0a2a5f3c36739098dd5476175837ec844b328f8.png)

If you send in a screenshot of what your Firebase Database looks like I can show you how to alter the blocks a bit if it doesn’t look the same as the example 🙂

---

<div class="post-metadata">

**Author:** ![ronymarcosdci](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronymarcosdci/32/39424_2.png) [@ronymarcosdci](https://community.thunkable.com/u/ronymarcosdci)\
**Post date:** [May 25, 2020, 7:04pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/3 "2020-05-25T19:04:11Z")

</div>

> [@eoinparkinson](#):
>
> If you send in a screenshot of what your Firebase Database looks like I can show you how to alter the blocks a bit if it doesn’t look the same as the example 🙂

you were great, i’m creating a registration method, and as soon as the user clicks create registration the app should check if that username is available … at the moment the logical blocks on the platform are just to save the data entered

---

<div class="post-metadata">

**Author:** ![ronymarcosdci](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronymarcosdci/32/39424_2.png) [@ronymarcosdci](https://community.thunkable.com/u/ronymarcosdci)\
**Post date:** [May 25, 2020, 7:06pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/4 "2020-05-25T19:06:47Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/b/9b9fe8a5934d0a006f1e5ee9abfd346fdfe07431.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/2/2277f23ff42f3915bcdab561cfd37a9a4c922654.png)

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [May 25, 2020, 8:40pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/5 "2020-05-25T20:40:12Z")

</div>

Hi,

I meant your Firebase Realtime Database, can you send me a screenshot that looks something like this:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/15d6241e569c038f692d1e430b6c971620d99e41.png)

This screenshot is from [console.firebase.google.com/](http://console.firebase.google.com/) —your—project—here—

---

<div class="post-metadata">

**Author:** ![ronymarcosdci](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronymarcosdci/32/39424_2.png) [@ronymarcosdci](https://community.thunkable.com/u/ronymarcosdci)\
**Post date:** [May 26, 2020, 1:42pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/6 "2020-05-26T13:42:02Z")

</div>

![WhatsApp Image 2020-05-26 at 10.40.29](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/d/0d8e2b50506f5b2b77d5fe1aa384125e3d59b339.jpeg)

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [May 26, 2020, 2:54pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/7 "2020-05-26T14:54:07Z")

</div>

Are you wanting to check the object **nome** for duplicates?

---

<div class="post-metadata">

**Author:** ![ronymarcosdci](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronymarcosdci/32/39424_2.png) [@ronymarcosdci](https://community.thunkable.com/u/ronymarcosdci)\
**Post date:** [May 26, 2020, 4:34pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/8 "2020-05-26T16:34:04Z")

</div>

no longer, now is the CPF

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [May 26, 2020, 5:01pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/9 "2020-05-26T17:01:43Z")

</div>

If **cpf** is always the same as its parent object, then the blocks above should work fine, if it is not the same, you can simply add in a get property of object block, like so:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/e/ae949005cb387d96bf9b4a2784dfaad55733a79d.png)

If your tag **cliente** has a parent then you could need to adjust the Firebase key value slightly to adjust this.

You can then use the sort blocks that I had showed you above already. Let us know how you get on, and if this worked you can mark it as solved 🙂

---

<div class="post-metadata">

**Author:** ![ronymarcosdci](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronymarcosdci/32/39424_2.png) [@ronymarcosdci](https://community.thunkable.com/u/ronymarcosdci)\
**Post date:** [May 26, 2020, 5:04pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/10 "2020-05-26T17:04:25Z")

</div>

> [@eoinparkinson](#):
>
> If your tag **cliente** has a parent then you could need to adjust the Firebase key value slightly to adjust this.
> 
> You can then use the sort blocks that I had showed you above already. Let us know how you get on, and if this worked you can mark it as solved 🙂

Ok, now I’m going to test \<3

---

<div class="post-metadata">

**Author:** ![ryan\_hall\_apps](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@ryan\_hall\_apps](https://community.thunkable.com/u/ryan_hall_apps)\
**Post date:** [May 26, 2020, 5:34pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/11 "2020-05-26T17:34:21Z")

</div>

You may be ale to do this without much code in thunkable.

Make a rule in your realtime db that validates for duplicates. Might look something like, “.validate”: “!data.exists()”.

Then you can check using your realtime db block and if there is a duplicate it will return an error.

---

<div class="post-metadata">

**Author:** ![ronymarcosdci](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronymarcosdci/32/39424_2.png) [@ronymarcosdci](https://community.thunkable.com/u/ronymarcosdci)\
**Post date:** [May 26, 2020, 5:38pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/12 "2020-05-26T17:38:47Z")

</div>

You should print a document to assist if it is not too much abuse of me?

---

<div class="post-metadata">

**Author:** ![ronymarcosdci](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronymarcosdci/32/39424_2.png) [@ronymarcosdci](https://community.thunkable.com/u/ronymarcosdci)\
**Post date:** [May 26, 2020, 5:45pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/13 "2020-05-26T17:45:12Z")

</div>

there is no more got value in fire base?

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [May 26, 2020, 6:55pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/14 "2020-05-26T18:55:16Z")

</div>

@ronymarcosdci what do you mean?

> [@ronymarcosdci](#):
>
> there is no more got value in fire base?

@ryan_hall_apps you should post a guide here on how to achieve the same result as the few blocks shared above, just as future reference for anybody searching this topic.

Thanks.

---

<div class="post-metadata">

**Author:** ![ryan\_hall\_apps](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@ryan\_hall\_apps](https://community.thunkable.com/u/ryan_hall_apps)\
**Post date:** [May 27, 2020, 3:01pm UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/15 "2020-05-27T15:01:14Z")

</div>

Sorry everyone, I thought Firebase would validate for unique values. This does not seem to be the case and is feature request by many users.

\*\*Using Firebase rules does not work to find unique values.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:28am UTC](https://community.thunkable.com/t/how-to-check-the-name-repeated-in-firebase-with-thunkable-x/590463/16 "2024-11-08T11:28:57Z")

</div>


