# Cloud Variable - Get properties from Real time Firebase lists - Help needed please

**URL:** <https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [April 6, 2020, 1:37pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287 "2020-04-06T13:37:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 1:37pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/1 "2020-04-06T13:37:04Z")

</div>

Good day,

I have created a Firebase structure like this and would appreciate it if you could help me with the correct blocks to get the properties of a list within a list. I have managed to create the database from Thunkable, but I struggle to get values/properties from nested lists. I do not use the Real time component, but rather the Cloud Variables as recommended. - Thank you in advance.!

[Cloud Variable Help|497x500](https://community.thunkable.com/uploads/short-url/4F08YfUH9kGZHDn4vZocpsB85cg.png)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 2:02pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/2 "2020-04-06T14:02:24Z")

</div>

Hey! @dmndeklerkeb, welcome to the community and thanks for posting! 👋

Can you try something like this?

 ![Screen Shot 2020-04-06 at 9.46.33 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/0/c024df3dc1f9498afdae0b8a03a62a01c7e89ea1.png)

You could try remixing this app to see something similar in action  
[![Screen Shot 2020-04-06 at 9.48.21 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/1/717d1ade131bc95d3108f3e7c1e2cbe42271cd79.png)](http://jaredgibb.xyz/index.php/2020/03/29/sample-apps/)

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 2:07pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/3 "2020-04-06T14:07:50Z")

</div>

Thank you for your help with this. I will give it a go later and will let you know. I understand what you have done here. Thanks again. I have remixed the NedtdList and will also look through that. Will keep you posted. 👋

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 4:30pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/4 "2020-04-06T16:30:03Z")

</div>

Hi,

I have tried the way you suggested but it does not fetch the property. I also tried the way in your NestdList. Bear in mind I do not use a listview component. I would like to fetch a value based on a stored user ID and then would like to do some validation. If the user is not in the list, I would like to add the new user to the list of users of that specific group. The whole idea is to check if the stored user is in the list or not and if so, to avoid saving the user ID as a duplicate in the list.

I hope this clarify more of what I am struggling with. Thanks for you advice in advance.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 5:07pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/5 "2020-04-06T17:07:55Z")

</div>

Hey there @dmndeklerkeb  
What about something like this?

 ![Screen Shot 2020-04-06 at 12.55.29 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/d/1d4f7bc12a548fef557948709454bda48be3b9d0.png)

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 5:40pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/6 "2020-04-06T17:40:55Z")

</div>

Hi, thank you so much. I will have a look and revert.

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 6:11pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/7 "2020-04-06T18:11:54Z")

</div>

Hi,  
I have exactly set it up like in your example. I would like to trigger the function with a button. What do I use then as an input to the function? And, should I leave open the GROUP and TOKEN fields?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 6:21pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/8 "2020-04-06T18:21:24Z")

</div>

The inputs needed would be for Group and Token. to do that, i would create function variables named \_group and \_token.

All other needed arguments should be self contained already. You will need to have already assigned a value to userID. this should be accomplished with the RealtimeDB login blocks.

maybe this?

 ![Screen Shot 2020-04-06 at 2.06.02 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/d/fdf0634e7664e5b2035af5ea3d0f57839894646c.png)

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 6:41pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/9 "2020-04-06T18:41:58Z")

</div>

Hi there,

Please check, this is my version. Unfortunately I don’t get it to work. Am I doing something wrong?

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

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 6:58pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/10 "2020-04-06T18:58:30Z")

</div>

let’s debug.  
first, see what the length of this is

 ![Screen Shot 2020-04-06 at 2.42.28 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/f/7f8dcc0817db9d5441acc4e4e903c403bb5cfa9d.png)

I’m wondering, was cloudvariable set as a list anywhere in the app already or did you give it a predefined data structure?

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 7:46pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/11 "2020-04-06T19:46:12Z")

</div>

The length is 3 for now. The cloud variable was set to an empty list before I used it to create the 3 records. See below.

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

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 7:47pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/12 "2020-04-06T19:47:58Z")

</div>

which part isnt working? ensuring no duplicates are made?

perfect! next step, see if after running that loop does \_addDontAdd equal anything?  
I also have another idea

let me put it together

how about this as the loop.  
this may work.

 ![Screen Shot 2020-04-06 at 3.38.31 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/e/eeaf25d556bff138080301727595b5036c3fbc0d.png)

plus the other blocks. but a loop instead of a Count By block

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 7:54pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/13 "2020-04-06T19:54:15Z")

</div>

\_addDontAdd returns ‘undefined’

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 7:55pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/14 "2020-04-06T19:55:59Z")

</div>

strange!

If you set it to 0, and only perform math operations with it then it should still return a value.

I also caught an error in my code. you dont want to add to list \_addDontAdd, this value is just to let the app know wehter or not to add another user. You would want to add to the list of GROUPS

 ![Screen Shot 2020-04-06 at 3.41.13 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/8/587872f0cbf868a2336c63c399125cf705bebf08.png)

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 8:02pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/15 "2020-04-06T20:02:25Z")

</div>

I have seen it also that \_addDontAdd was not initialized as a list. I will try agin.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 8:03pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/16 "2020-04-06T20:03:59Z")

</div>

not necessary. you aren’t making that value a list ever according to my code.

it should only be used to count if there were matches between the input and the currently existing data.

the first logic here makes sense, but when you get to ‘in list’ you want to add to list ‘GROUPS’. you are not adding into list \_addDontAdd because 1) it’s not a list type variable 2) it’s not your user list

lemme know if you get it working!

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 8:04pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/17 "2020-04-06T20:04:59Z")

</div>

Got you

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 6, 2020, 8:10pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/18 "2020-04-06T20:10:25Z")

</div>

Ok, so I got three new entries in the database, which look like this: #3 - #5. It added similar entries and the check for duplicates did not work.

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

Sorry I have run out of posts on my first day. It says I have to wait 17 hours. So I will add to this. I had a wrong Group name variable assigned. Rectified that and now it creates 6 new records of the same.

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

Yes it will. I have seen in the code with the first If statement testing for same User ID and then it goes and add the records in the second If statement. What I did is, I have changed the = to /= and now if I run it, it does not add, but it also does not give me the error message. So I think a little bit of tweaking will get it to work. How do I share my private project?

How can I add to the list of user ID’s within the user list of one group. Instead it saves an additional record. Is this how it suppose to work with firebase?

Ah, ok. That will work for me, however, I will have to experience with that first and see if I can do that. Alternatively, if it is not too much to ask you could I ask you to help me to what i should do. I am still new in this and would really appreciate.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 8:25pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/19 "2020-04-06T20:25:19Z")

</div>

so it added 3 new entries. then it added 6 entries?

I’m guessing if you ran it again, it would add 12 entries?

can you share your code?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 6, 2020, 8:43pm UTC](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287/20 "2020-04-06T20:43:36Z")

</div>

To add to the users of a single user group, you can get and remove that object from the overall list of uers groups, append an item to that individual object, and then replace the object in the overal list.

[Next page](https://community.thunkable.com/t/cloud-variable-get-properties-from-real-time-firebase-lists-help-needed-please/559287.md?page=2)
