# How to connect Firebase values with Thunkable

**URL:** <https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230>\
**Category:** Questions about Thunkable X\
**Created:** [April 14, 2021, 6:02pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230 "2021-04-14T18:02:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![aishat.yatarovarxr](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@aishat.yatarovarxr](https://community.thunkable.com/u/aishat.yatarovarxr)\
**Post date:** [April 14, 2021, 6:02pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/1 "2021-04-14T18:02:18Z")

</div>

Hey everyone! I am confused as to how to get the value from firebase and receive the value from thunkable using cloud variables. Can anybody help me?

---

<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 14, 2021, 7:10pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/2 "2021-04-14T19:10:46Z")

</div>

In Thunkable there are 3 types of variables that you can set in the initialize stage.

- App variables which will only be available as long as the app is running and once the app is closed or exit then the values are gone.

- Stored variables which will save the values in your mobile so that the next time the app runs can read these variables and show/manipulate the values.

- Cloud variables are those who maps the keys of the Firebase RTDB. So when you want to read data stored in Firebase under user\_id/job\_id/job\_code for example then you just add a cloud variable to your app and the name of the variable is the database key (in this example user\_id/job\_id/job\_code) and the variable will show the content of this key in the database.

That is in short.

---

<div class="post-metadata">

**Author:** ![aishat.yatarovarxr](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@aishat.yatarovarxr](https://community.thunkable.com/u/aishat.yatarovarxr)\
**Post date:** [April 16, 2021, 4:30pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/3 "2021-04-16T16:30:35Z")

</div>

So how do I get the value that is under that key?

---

<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 16, 2021, 4:33pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/4 "2021-04-16T16:33:05Z")

</div>

Just have the cloud variable name to be the same as the key in the database.

---

<div class="post-metadata">

**Author:** ![aishat.yatarovarxr](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@aishat.yatarovarxr](https://community.thunkable.com/u/aishat.yatarovarxr)\
**Post date:** [April 16, 2021, 4:34pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/5 "2021-04-16T16:34:04Z")

</div>

But how do I retrieve the value? Should I set the my label to the cloud variable?

---

<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 16, 2021, 4:35pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/6 "2021-04-16T16:35:00Z")

</div>

Assign the cloud variable to a label in your screen and the value will show as the label text

---

<div class="post-metadata">

**Author:** ![aishat.yatarovarxr](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@aishat.yatarovarxr](https://community.thunkable.com/u/aishat.yatarovarxr)\
**Post date:** [April 16, 2021, 4:59pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/7 "2021-04-16T16:59:44Z")

</div>

![Screenshot (27)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/d/5d338a47c020a7a421135ab0077f51fe7e042294.png)  
 ![Screenshot (28)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/8/58bf51e0ab9568633903c21fe3235a75fbb23371.png)

Is this correct?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 16, 2021, 5:04pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/8 "2021-04-16T17:04:11Z")

</div>

No. You need to use this block to set firebase values:

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

And this block to retrieve them:

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

Change the variable type from “app” to “cloud” and replace “name” with “user\_id”:

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

---

<div class="post-metadata">

**Author:** ![aishat.yatarovarxr](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@aishat.yatarovarxr](https://community.thunkable.com/u/aishat.yatarovarxr)\
**Post date:** [April 16, 2021, 5:25pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/9 "2021-04-16T17:25:42Z")

</div>

![Screenshot (29)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/0/100b73ceafc8ca10e47053bcd0712ff695112ee4.png)

Like this?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 16, 2021, 6:32pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/10 "2021-04-16T18:32:38Z")

</div>

Nope. What are you trying to do? Are you wanting someone to type in a value and then have it stored in Firebase? Because that’s what the third set of blocks I posted above would do.

---

<div class="post-metadata">

**Author:** ![aishat.yatarovarxr](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@aishat.yatarovarxr](https://community.thunkable.com/u/aishat.yatarovarxr)\
**Post date:** [April 16, 2021, 8:35pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/12 "2021-04-16T20:35:00Z")

</div>

I want to retrieve the value from Firebase. I have a value under the name “user\_id” in firebase. I want to set the text input to the value of “user\_id”

How do I do that?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 17, 2021, 12:19am UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/13 "2021-04-17T00:19:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aishat.yatarovarxr](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@aishat.yatarovarxr](https://community.thunkable.com/u/aishat.yatarovarxr)\
**Post date:** [April 17, 2021, 7:53am UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/14 "2021-04-17T07:53:50Z")

</div>

Thank you. I also wanted to retrieve my keys from Firebase (not values). How do I do that?

---

<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 17, 2021, 9:38am UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/15 "2021-04-17T09:38:21Z")

</div>

See this

> [@How retrieve the key from Firebase?](https://community.thunkable.com/t/how-retrieve-the-key-from-firebase/1229227/2):
>
> Suppose you have a key named “user\_ids” which all your user ID’s under it, you can use a List Viewer to show the user ID’s like this

---

<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:25pm UTC](https://community.thunkable.com/t/how-to-connect-firebase-values-with-thunkable/1224230/16 "2024-11-08T13:25:14Z")

</div>


