# How to use email as a key in our firebase databse

**URL:** https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491
**Category:** Questions about Thunkable X
**Created:** [April 30, 2021, 4:32pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491 "2021-04-30T16:32:35Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![charvi2k9gsbk2i](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@charvi2k9gsbk2i](https://community.thunkable.com/u/charvi2k9gsbk2i)
#### Post date: [April 30, 2021, 4:32pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/1 "2021-04-30T16:32:35Z")

</div>

Can the user use the email as a key to store data in our firebase database

---

<div class="post-metadata">

### Author: ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)
#### Post date: [April 30, 2021, 4:38pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/2 "2021-04-30T16:38:10Z")

</div>

Ok （1）you can use sign in mode ( Need to enable escrow ）and set firebase rules:  
`{ "rules": { ".read": "auth.uid != null", ".write": "auth.uid != null" } }`

use UID

---

<div class="post-metadata">

### Author: ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)
#### Post date: [April 30, 2021, 4:41pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/3 "2021-04-30T16:41:08Z")

</div>

(2) key cannot use “@” or “.”  
replace “@” to &1 and “.” to &2

Email cannot use & - % #  
Key cannot use @ .

---

<div class="post-metadata">

### Author: ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)
#### Post date: [April 30, 2021, 4:43pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/4 "2021-04-30T16:43:41Z")

</div>

(3) only use @gmail.com  
Get text before@

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [April 30, 2021, 4:58pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/5 "2021-04-30T16:58:33Z")

</div>

Use the Sign-In component to validate Email. The sign-in component will generate a unique ID for each email. Use this UID in your RTDB.

---

<div class="post-metadata">

### Author: ![charvi2k9gsbk2i](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@charvi2k9gsbk2i](https://community.thunkable.com/u/charvi2k9gsbk2i)
#### Post date: [April 30, 2021, 5:39pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/6 "2021-04-30T17:39:32Z")

</div>

thank you so much that’s a really good idea I will try it out and get back to you tomorrow…  
Thank you

---

<div class="post-metadata">

### Author: ![charvi2k9gsbk2i](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@charvi2k9gsbk2i](https://community.thunkable.com/u/charvi2k9gsbk2i)
#### Post date: [April 30, 2021, 5:40pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/7 "2021-04-30T17:40:29Z")

</div>

i think im gonna go for replacing the text option rather than getting the text before @gmail.com 😀

---

<div class="post-metadata">

### Author: ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)
#### Post date: [April 30, 2021, 11:53pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/8 "2021-04-30T23:53:06Z")

</div>

If you only allow gmail to log in  
Get `"example"`@gmail.com

---

<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, 1:22pm UTC](https://community.thunkable.com/t/how-to-use-email-as-a-key-in-our-firebase-databse/1255491/9 "2024-11-08T13:22:46Z")

</div>


