im trying to get my data and show it in List_Viewer from Realtime Database
this my blocks below it work but its giving me just the last item in the data
The problem is that you are looping through your database values but setting the list viewer’s text items to a list that contains a single item.
Instead, within the loop, you need to use the insert at last block from the List drawer to add each value to the list. You’ll need a separate list variable for that.
Then, once the loop has completed (below the
for each item in list block), you can assign the list viewer’s text items to the list variable that you used within the loop.
I use this same approach in one of my apps. I get the bucket (a JSON object made up of more JSON object) and assign that to a variable. Then i extract the keys from that main bucket (a list of dates) and assign that to a different variable. Then, loop through the keys and extract the desired value. a score associated with each date/key that i have in that bucket.
get property <YOUR PROPERTY/KEY NAME> of object (get property Key of object Bucket)
^^this loops through each object in the bucket and allows you to grab the property you want from each and throw it into a list to display in your list viewer
Thank you all for helping
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.