# \[Solved\] How to take nested value from FIrebase

**URL:** <https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [December 14, 2020, 6:36am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323 "2020-12-14T06:36:55Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 6:36am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/1 "2020-12-14T06:36:55Z")

</div>

How can I take this value from firebase as a list to show it in a list viewer  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/0/306a97f740b7248e56b14b25edcaaa18d0c241e7.png)

* * *

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

This is not working ⬆

---

<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:** [December 14, 2020, 7:07am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/2 "2020-12-14T07:07:01Z")

</div>

Firebase will return an object not a list so use the methods in the object drawer.

**Note**  
It is always a good practice to first check for errors before proceeding with reading values

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 7:55am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/3 "2020-12-14T07:55:00Z")

</div>

Ok, Thanks 😀 😀 @muneer

Can you please share a screenshot of getting this values using the objects block?  
actually I have never used those.

---

<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:** [December 14, 2020, 8:10am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/4 "2020-12-14T08:10:07Z")

</div>

Will do it later when I’m in front of the computer

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 8:18am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/5 "2020-12-14T08:18:30Z")

</div>

Ok, please send it by today

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [December 14, 2020, 8:43am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/6 "2020-12-14T08:43:40Z")

</div>

The link below shows how to get and set nested values from a firebase json tree. Basically, use a slash to separate nodes in the tree.

> [@Replace GET or SAVE Blocks with cloud variables](http://community.thunkable.com/t/thunkable-hack-deep-firebase-json-data-manipulation-without-using-get-or-save-blocks/975738):
>
> I just discovered a VERY simple and fast way to get and set Firebase data without using the GET or SAVE blocks (which has all sorts of asynchronous issues). The 2 any button click blocks below return the same data. Just put the GET block KEY variable into the CLOUD variable name and PRESTO. You have a synchronous call to firebase! Similarly, you can set data anywhere in the JSON Hierarchy using cloud variables. Both of the examples below update Firebase, but the CLOUD based solution…

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 8:55am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/7 "2020-12-14T08:55:38Z")

</div>

How can I use this method to get the values in a list form?

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [December 14, 2020, 9:11am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/8 "2020-12-14T09:11:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 9:33am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/9 "2020-12-14T09:33:57Z")

</div>

@drted How can I get all the values from that list? Like if it has 12 participants it will all of them but if it has 5 participants then it will take those 5?

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 9:46am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/10 "2020-12-14T09:46:58Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/4/444fb02a1c4d814435d9a6e07dbf7554964f21a6.png)  
I have figured it out!!  
Here app extra is the number of participants ( **counting from 0 not 1** ) and the textinput holds the first key. And the list is getting saved in the app temporary list.

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [December 14, 2020, 10:01am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/11 "2020-12-14T10:01:18Z")

</div>

@roumak-coder,

Excellent! I’m glad to have a better understanding of how firebase works.

Something to consider, you can do the same thing with these 2 blocks:

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

Fewer blocks and it will run much faster!

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 10:34am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/12 "2020-12-14T10:34:39Z")

</div>

Wow, that’s great. That means in place of Firebase DB I can use an cloud variable. Am I right?

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [December 14, 2020, 10:39am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/13 "2020-12-14T10:39:47Z")

</div>

100%

---

<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:** [December 14, 2020, 10:51am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/14 "2020-12-14T10:51:06Z")

</div>

Great,  
The list is practical in this case because you have only names but when you have something like user name and email address then you will need to look at it as a JSON object instead if a list

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

I made a quick app and used similar entries in you DB to simulate the situation. The [get object properties of] will list the numbers that are not shown if you use the list.

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

Hope that clarifies why sometimes you need to look at at as a list and another time as an object of a list.

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 10:56am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/15 "2020-12-14T10:56:32Z")

</div>

Hey @muneer and @drted thanks for helping me out!! 😄 😄 Just a quick question, that if I create a cloud variable will it be saved in firebase DB? and can I take that data using the same 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:** [December 14, 2020, 11:14am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/16 "2020-12-14T11:14:01Z")

</div>

If you have the Web API Key and Database URL set in the project setting page then it will be saved to your Firebase DB.

In case you have not supplied your database credentials, then it will be saved in the cloud storage of Thunkable cloud which is temporary only.

Hope to have answered you.

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [December 14, 2020, 11:16am UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/17 "2020-12-14T11:16:19Z")

</div>

Ok, Thanks

---

<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, 12:19pm UTC](https://community.thunkable.com/t/solved-how-to-take-nested-value-from-firebase/1035323/18 "2024-11-08T12:19:49Z")

</div>


