# Please help me with this code!

**URL:** <https://community.thunkable.com/t/please-help-me-with-this-code/3675630>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, beginner, help\
**Created:** [March 20, 2025, 10:51pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630 "2025-03-20T22:51:13Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![krish05](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/krish05/32/200523_2.png) [@krish05](https://community.thunkable.com/u/krish05)\
**Post date:** [March 22, 2025, 7:56pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/21 "2025-03-22T19:56:36Z")

</div>

In your Thunkable project, add a “Realtime DB component” (available in Snap to Place projects) or use cloud variables in the Drag and Drop editor. It really does depend on what program you are using.

---

<div class="post-metadata">

**Author:** ![schoolwork7002lro2tb](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@schoolwork7002lro2tb](https://community.thunkable.com/u/schoolwork7002lro2tb)\
**Post date:** [March 22, 2025, 7:58pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/22 "2025-03-22T19:58:17Z")

</div>

There can also be another way in which I suppose replacing @ and . with any other application symbol or with just “\_” could work.

I’m not sure although…

The JSON code:

```auto
{
  "Data": {
    "exampleKey": "exampleValue",
    "users": {
      "work7002_gmail_com": {
        "email": "work7002@gmail.com"
      },
      "school7002_gmail_com": {
        "email": "school7002@gmail.com"
      }
    }
  },
  "organization": {
    "kuro": "sfjg"
  },
  "thunkableAccess": true
}

```

What block shall I use?

This way, i suppose, reading data would be easier?

---

<div class="post-metadata">

**Author:** ![schoolwork7002lro2tb](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@schoolwork7002lro2tb](https://community.thunkable.com/u/schoolwork7002lro2tb)\
**Post date:** [March 22, 2025, 7:59pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/23 "2025-03-22T19:59:52Z")

</div>

I already added a “Realtime DB component” @krish0 I can easily input data, the thing is I’m unable to read it properly…

---

<div class="post-metadata">

**Author:** ![krish05](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/krish05/32/200523_2.png) [@krish05](https://community.thunkable.com/u/krish05)\
**Post date:** [March 22, 2025, 8:01pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/24 "2025-03-22T20:01:10Z")

</div>

Looking at the Thunkable Docs right now, give me a couple minutes.

---

<div class="post-metadata">

**Author:** ![krish05](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/krish05/32/200523_2.png) [@krish05](https://community.thunkable.com/u/krish05)\
**Post date:** [March 22, 2025, 8:02pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/25 "2025-03-22T20:02:10Z")

</div>

From the Thunkable YouTube channel and docs:

[![](https://img.youtube.com/vi/2TnfendzlBI/maxresdefault.jpg "How to Read Data in a Firebase Realtime Database") ](https://www.youtube.com/watch?v=2TnfendzlBI)

[![](https://img.youtube.com/vi/mY2omvP9oRM/maxresdefault.jpg "How to Update Data in a Firebase Realtime Database") ](https://www.youtube.com/watch?v=mY2omvP9oRM)

> **[Connect a Firebase Realtime Database | Thunkable Docs](https://docs.thunkable.com/blocks/blocks/variables-overview/connect-a-firebase-realtime-database)**

Please let me know if this worked!

---

<div class="post-metadata">

**Author:** ![schoolwork7002lro2tb](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@schoolwork7002lro2tb](https://community.thunkable.com/u/schoolwork7002lro2tb)\
**Post date:** [March 22, 2025, 8:32pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/26 "2025-03-22T20:32:39Z")

</div>

Buddy!  
You won’t believe but I’ve watched every video, read every article, NOTHING HELPED!

---

<div class="post-metadata">

**Author:** ![schoolwork7002lro2tb](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@schoolwork7002lro2tb](https://community.thunkable.com/u/schoolwork7002lro2tb)\
**Post date:** [March 22, 2025, 8:39pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/27 "2025-03-22T20:39:32Z")

</div>

Alright!  
So, after 2-3 days of struggle, I figured it out, that MAYBE the thing I was talking about, was way more complex.

> Getting value and find it’s key.

Since every userID is unique, and unpredictable, it will NEVER work.

I tried creating a new userID according to email, replacing every “@” and “.” with “\_”.

and then fetched data and use code to check if “schoolwork702\_gmail\_com”  
existed or not.

and guess what! IT WORKED!

- blocks:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/4/d42c971aac076d53d8c552dd8c0012abdcd47956.png)

and it will answer No/Yes accordingly!

Now if a user tried to register again, it will firstly check if userID (same email is in use or not) and it I can now control is user have an account from same ID or a new one.

NOTE: I’m using signing with google.

---

<div class="post-metadata">

**Author:** ![schoolwork7002lro2tb](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@schoolwork7002lro2tb](https://community.thunkable.com/u/schoolwork7002lro2tb)\
**Post date:** [March 22, 2025, 8:43pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/28 "2025-03-22T20:43:21Z")

</div>

I appreciate your sincere efforts buddy!

---

<div class="post-metadata">

**Author:** ![krish05](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/krish05/32/200523_2.png) [@krish05](https://community.thunkable.com/u/krish05)\
**Post date:** [March 22, 2025, 8:51pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/29 "2025-03-22T20:51:19Z")

</div>

Congratulations! I’m glad I tried to help, great job on finding it yourself!

---

<div class="post-metadata">

**Author:** ![schoolwork7002lro2tb](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@schoolwork7002lro2tb](https://community.thunkable.com/u/schoolwork7002lro2tb)\
**Post date:** [March 22, 2025, 8:53pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/30 "2025-03-22T20:53:52Z")

</div>

Thanks a lot @krish05 and @tatiang

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [June 20, 2025, 8:54pm UTC](https://community.thunkable.com/t/please-help-me-with-this-code/3675630/31 "2025-06-20T20:54:17Z")

</div>

Closed on June 20, 2025, 8:54pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.thunkable.com/t/please-help-me-with-this-code/3675630.md?page=1)
