# Get properties of object stored as a cloud variable list

**URL:** <https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153>\
**Category:** Questions about Thunkable X\
**Created:** [March 17, 2021, 11:02pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153 "2021-03-17T23:02:35Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![charles.crawfordcu5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/charles.crawfordcu5/32/98676_2.png) [@charles.crawfordcu5](https://community.thunkable.com/u/charles.crawfordcu5)\
**Post date:** [March 17, 2021, 11:02pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/1 "2021-03-17T23:02:35Z")

</div>

I’m defining a cloud variable like this:

 ![Screen Shot 2021-03-17 at 3.31.52 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/3/63d43aaefeaea9750ce9204fa6ec61299fd8a8cd.png)

which produces a db structure like this:

 ![Screen Shot 2021-03-17 at 3.32.59 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/f/9f62bfee91c78ac58cf63d52d77fa51405b2b875.png)

On another screen, I want to query the list stored in the ‘round’ object, and display what is stored under the ‘p1d’ field. UserID+date should give me a unique key for each entry in the list, but I can’t figure out the combination of blocks to make the query work.

Help please!!

---

<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:** [March 20, 2021, 2:13pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/2 "2021-03-20T14:13:18Z")

</div>

Can you explain further.  
round is your top key. Under this key is a numbered list (0,1,2,…) Each element in this list is not a simple text element but an object comprising number of element.

What exactly you want from this structure to be displayed in your screen?

---

<div class="post-metadata">

**Author:** ![charles.crawfordcu5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/charles.crawfordcu5/32/98676_2.png) [@charles.crawfordcu5](https://community.thunkable.com/u/charles.crawfordcu5)\
**Post date:** [March 20, 2021, 6:08pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/3 "2021-03-20T18:08:05Z")

</div>

I want to be able to store, retrieve, and update individual rounds. Many users will be able to start rounds, then take some action in the physical world, and record their results in the app. So I need to be able to:  
A) find, display, and update properties of a user’s most recent round (to record results)  
B) find and display all the rounds from a particular user (to show history)

I’ve never worked with an object-oriented DB structure before, so I’m basically thinking of each item under the “round” object (0,1,2,…) as a row in a relational DB table. I’m not sure if this approach is optimal, so I’m def. open to any other feedback if there’s a better way to accomplish this. 🙂

I thought of storing the entry of the numbered list (0,1,2,…) in an app variable when each round is created, but I can’t figure out how to get that value. I could query for the last item in the list, but that’s prone to failure if two users create rounds at the same time.

---

<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:** [March 20, 2021, 8:05pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/4 "2021-03-20T20:05:11Z")

</div>

I’ll try to replicate what you have and produce an example project. It would be easier to then explain based on a working app.

---

<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:** [March 24, 2021, 8:19am UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/5 "2021-03-24T08:19:34Z")

</div>

Please see the sample project.  
[https://x.thunkable.com/projectPage/605af190400c170013e66b78](https://x.thunkable.com/projectPage/605af190400c170013e66b78)

You need to supply the API Key and Database URL in the project properties page and just press the button to get the data stored in your database in a list viewer.

When you select an item from the list viewer, more details are shown in two labels.

Let me know what you are trying to achieve so we can progress further.

---

<div class="post-metadata">

**Author:** ![charles.crawfordcu5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/charles.crawfordcu5/32/98676_2.png) [@charles.crawfordcu5](https://community.thunkable.com/u/charles.crawfordcu5)\
**Post date:** [March 26, 2021, 7:52pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/6 "2021-03-26T19:52:35Z")

</div>

Thanks for taking the time to create this!

I realize that I’m storing these objects as a list, and so that might require me to use a list viewer, but if possible, I would like to find a way to display parameters of individual rounds (and update them) without the user needing to deal with the list. They won’t know which number (0,1,2,…) is relevant - I’d like that to be “behind the scenes.”

Should I use some other method of storing the data?

---

<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:** [March 26, 2021, 9:32pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/7 "2021-03-26T21:32:02Z")

</div>

Of course you can have the (0,1,2,…) In the back scene but you need to first select one of the keys (or a combination of two keys) as a primary key to show it to the user in the list viewer.

Let me know which of your data is the main key you want it listed and when the user selects it then you will show the rest of the data and maybe allow the user to change some of the contents.

I can redesign the project easily.

---

<div class="post-metadata">

**Author:** ![charles.crawfordcu5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/charles.crawfordcu5/32/98676_2.png) [@charles.crawfordcu5](https://community.thunkable.com/u/charles.crawfordcu5)\
**Post date:** [March 26, 2021, 10:20pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/8 "2021-03-26T22:20:33Z")

</div>

Here’s a quick wireframe of what I’m trying to achieve:

 ![Screen Shot 2021-03-26 at 3.11.21 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/8/c89e8fc5a248536224f222b121b9f8110737ab46.png)

I believe that for this to work, I need to be able to get to the specific object in the “round” list that was created [when [buttonRound] [Click]] in my code screenshot, above. I think that ‘userID’ + ‘date’ should give me a unique key to any individual round.

---

<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:** [March 26, 2021, 10:43pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/9 "2021-03-26T22:43:43Z")

</div>

The userID you showed was empty but I can get the date, userID combination.

So, is it each user goes through the round or any user can pick whatever in the database and start using it?

If your App is user specific then you might want to consider restructuring your data so that:

round  
----userID1  
--------date1  
--------p1d  
--------p1s  
--------p2d  
--------p2s

--------date2  
--------p1d  
--------p1s  
--------p2d  
--------p2s

----userID2  
--------date1  
--------p1d  
--------p1s  
--------p2d  
--------p2s

--------date2  
--------p1d  
--------p1s  
--------p2d  
--------p2s

Which should result in easier access to the data.

---

<div class="post-metadata">

**Author:** ![charles.crawfordcu5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/charles.crawfordcu5/32/98676_2.png) [@charles.crawfordcu5](https://community.thunkable.com/u/charles.crawfordcu5)\
**Post date:** [March 26, 2021, 11:02pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/10 "2021-03-26T23:02:16Z")

</div>

The app should be user-specific. Users will get a userID from the thunkable/firebase ‘Sign In’ component.

I like your plan for the structure, but I don’t know how to create that setup. The list block I’m using just creates the (0,1,2,…) by default. How can I define the object to have a userID in the place of that (0,1,2,…)?

---

<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:** [March 27, 2021, 8:01pm UTC](https://community.thunkable.com/t/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/11 "2021-03-27T20:01:45Z")

</div>

I made some changes to my project to display a more meaningful info in the list viewer. Please remix the project to see the updates. I inserted some names in the database to make the list proper.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/6/26ca8c36a77aa9b1d52d9d27d3a62bf39be82c3d.png)

---

<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/get-properties-of-object-stored-as-a-cloud-variable-list/1173153/12 "2024-11-08T13:25:57Z")

</div>


