# Populating lists

**URL:** <https://community.thunkable.com/t/populating-lists/2851862>\
**Category:** Questions about Thunkable X\
**Created:** [February 23, 2024, 9:55am UTC](https://community.thunkable.com/t/populating-lists/2851862 "2024-02-23T09:55:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sammy-wrightcuhb](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sammy-wrightcuhb](https://community.thunkable.com/u/sammy-wrightcuhb)\
**Post date:** [February 23, 2024, 9:55am UTC](https://community.thunkable.com/t/populating-lists/2851862/1 "2024-02-23T09:55:37Z")

</div>

Is there a quicker way to populate lists?  
I have a list in my app that I want to populate with items that are drawing information from various different locations but I feel like it takes a while to populate each item. I would like it so that it is done within a couple of seconds of screen load but it is taking about 10 seconds.  
I think it might be due to how I am populating the lists but just wanted to check my theory.  
At present I have the app looking into my realtime database for each bit of info I want for each item (I am using a “for each item” block). The app then adds the info which I have defined by means of a “get property of object” chain. Then the app joins a few variables together to display the information I want. But would it be quicker to use a json script? Rather than individual locations for each piece of information?

My understanding on what JSON is exactly is improving but I might be still well off the mark.

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 23, 2024, 10:25am UTC](https://community.thunkable.com/t/populating-lists/2851862/2 "2024-02-23T10:25:28Z")

</div>

Hi, show also your current code so we can check it

---

<div class="post-metadata">

**Author:** ![sammy-wrightcuhb](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sammy-wrightcuhb](https://community.thunkable.com/u/sammy-wrightcuhb)\
**Post date:** [February 23, 2024, 11:54am UTC](https://community.thunkable.com/t/populating-lists/2851862/3 "2024-02-23T11:54:23Z")

</div>

Yeah here you go. Really I’m just looking to see if JSON is quicker than individual locations?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/f/dfc83a2b4b05b46280dd93766d102697c3d4453a.png)

---

<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:** [February 23, 2024, 4:16pm UTC](https://community.thunkable.com/t/populating-lists/2851862/4 "2024-02-23T16:16:29Z")

</div>

Each use of a cloud variable is a separate call to Firebase to get that value. So in your code, you’re using cloud variables once to define the loop list and then four times within each loop. So, for example, a list of 20 items will call Firebase a total of 81 times. So yes, I would expect that to be slow.

It would be much faster to get the entire Firebase data that you need and assign it to an app variable so that you are just accessing a local app variable each time the loop iterates.

---

<div class="post-metadata">

**Author:** ![sammy-wrightcuhb](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sammy-wrightcuhb](https://community.thunkable.com/u/sammy-wrightcuhb)\
**Post date:** [February 23, 2024, 4:32pm UTC](https://community.thunkable.com/t/populating-lists/2851862/5 "2024-02-23T16:32:11Z")

</div>

That does make sense. So would it be better to assign a JSON script to a variable then have my loop assign that JSON script to “app variable J”, then search for the specific data in that local variable?

That leads to a connected question; I am thinking of two ways to complete that what you’re saying.

1. I have a folder path on my realtime database that looks like this - "leagues/participants/json/_j_  
Where _j_ is a reference to a specific item (let’s call it CARREF). Then I hold a JSON script in this folder path related to a specific item.

or

1. I have the JSON for all items in one location such as “leagues/participants/json” and all items are part of the same JSON script.

Which would you think is better for large amounts of data (which I hope this to be at some point)?  
I know you can create lists within JSON but how would I then differentiate between different items within 1 JSON?

I appreciate your patience and I understand this must be simple for some but I am learning all from fresh.

---

<div class="post-metadata">

**Author:** ![sammy-wrightcuhb](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sammy-wrightcuhb](https://community.thunkable.com/u/sammy-wrightcuhb)\
**Post date:** [February 23, 2024, 4:44pm UTC](https://community.thunkable.com/t/populating-lists/2851862/6 "2024-02-23T16:44:28Z")

</div>

Just tested this and it certainly has sped things up hugely. Thankyou. Shall I create a new thread for my related question or can you answer in this thread?

---

<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:** [February 23, 2024, 4:58pm UTC](https://community.thunkable.com/t/populating-lists/2851862/7 "2024-02-23T16:58:59Z")

</div>

If it’s related, why not post it here?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [May 23, 2024, 4:59pm UTC](https://community.thunkable.com/t/populating-lists/2851862/8 "2024-05-23T16:59:39Z")

</div>

Closed on May 23, 2024, 4:59pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
