# Import a list from firebase

**URL:** <https://community.thunkable.com/t/import-a-list-from-firebase/1823355>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, beginner\
**Created:** [April 7, 2022, 5:59pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355 "2022-04-07T17:59:53Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![igorcastro018ffq0](https://avatars.discourse-cdn.com/v4/letter/i/ba8739/32.png) [@igorcastro018ffq0](https://community.thunkable.com/u/igorcastro018ffq0)\
**Post date:** [April 7, 2022, 5:59pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/1 "2022-04-07T17:59:53Z")

</div>

I need to make a list importing the properties name and value from firebase. Someone help me please!!!  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/7/d78c44932bbad54018d6b682e186301749889b31.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:** [April 7, 2022, 6:04pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/2 "2022-04-07T18:04:15Z")

</div>

What have you searched for on the forums or Google? What have you tried so far? What is/is not working? This has been discussed many times here.

---

<div class="post-metadata">

**Author:** ![igorcastro018ffq0](https://avatars.discourse-cdn.com/v4/letter/i/ba8739/32.png) [@igorcastro018ffq0](https://community.thunkable.com/u/igorcastro018ffq0)\
**Post date:** [April 7, 2022, 6:15pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/3 "2022-04-07T18:15:05Z")

</div>

I’ve seached on the forums and google. But every solution that I tried didn’t work. I’m a instructor and this is the solution I have in my material (but does not work to):

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/5/f5c97de2ee4e956c66ae350016ce7a0f8cf2f26e.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:** [April 7, 2022, 6:24pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/4 "2022-04-07T18:24:23Z")

</div>

I can help you with the blocks but I’ll need to see the JSON response you posted above as **text**.

---

<div class="post-metadata">

**Author:** ![igorcastro018ffq0](https://avatars.discourse-cdn.com/v4/letter/i/ba8739/32.png) [@igorcastro018ffq0](https://community.thunkable.com/u/igorcastro018ffq0)\
**Post date:** [April 7, 2022, 6:28pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/5 "2022-04-07T18:28:54Z")

</div>

```auto
{
"Janeiro" : {
"EXPENSES" : {
"ITEMS" : {
"Custos fixos" : {
"name" : "Custos fixos",
"value" : "1200"
}
},
"Total" : {
"value" : 1200
}
},
"INCOME" : {
"ITEMS" : {
"Extra" : {
"name" : "Extra",
"value" : "500"
},
"Salário" : {
"name" : "Salário",
"value" : "1500"
},
"mesada" : {
"name" : "mesada",
"value" : "200"
}
},
"Total" : {
"value" : 2200
}
}
}
}

```

---

<div class="post-metadata">

**Author:** ![igorcastro018ffq0](https://avatars.discourse-cdn.com/v4/letter/i/ba8739/32.png) [@igorcastro018ffq0](https://community.thunkable.com/u/igorcastro018ffq0)\
**Post date:** [April 7, 2022, 6:29pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/6 "2022-04-07T18:29:35Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![igorcastro018ffq0](https://avatars.discourse-cdn.com/v4/letter/i/ba8739/32.png) [@igorcastro018ffq0](https://community.thunkable.com/u/igorcastro018ffq0)\
**Post date:** [April 7, 2022, 6:30pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/7 "2022-04-07T18:30:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [April 7, 2022, 6:34pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/8 "2022-04-07T18:34:18Z")

</div>

Is it supposed to get the substring from letter #2 to letter #2 (both values are the same), or is it supposed to be something else?

---

<div class="post-metadata">

**Author:** ![igorcastro018ffq0](https://avatars.discourse-cdn.com/v4/letter/i/ba8739/32.png) [@igorcastro018ffq0](https://community.thunkable.com/u/igorcastro018ffq0)\
**Post date:** [April 7, 2022, 6:39pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/9 "2022-04-07T18:39:39Z")

</div>

Sorry! That’s the correct one:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/6/a6996b03d9c490924395b6dd53f76486ab33c69a.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:** [April 7, 2022, 6:43pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/10 "2022-04-07T18:43:45Z")

</div>

It’s a little tricky because your JSON doesn’t have a list/array. But it’s still possible… let me see if I can make you a demo.

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [April 7, 2022, 6:47pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/11 "2022-04-07T18:47:14Z")

</div>

Try changing the “{:” in the occurrence block to " : {"

---

<div class="post-metadata">

**Author:** ![igorcastro018ffq0](https://avatars.discourse-cdn.com/v4/letter/i/ba8739/32.png) [@igorcastro018ffq0](https://community.thunkable.com/u/igorcastro018ffq0)\
**Post date:** [April 7, 2022, 6:53pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/12 "2022-04-07T18:53:19Z")

</div>

it didn’t work

---

<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 7, 2022, 6:54pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/13 "2022-04-07T18:54:37Z")

</div>

Hey @igorcastro018ffq0, I’d encourage you to check out this setup! Would love to help you get setup here as I am a big fan of the power that Firebase provides!

> [@\[Solved\] How do I display data from the RealTime Database as a list in my app?](https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443/4):
>
> Your block should look like this

I use this method in a few apps. After you get it set up, if you aren’t having success, please share you block combination that you are using.

Also, please be sure that your firebase security rules are set to allow read/write access while you are testing your app.

---

<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:** [April 7, 2022, 7:28pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/14 "2022-04-07T19:28:32Z")

</div>

It would be better if you formatted your Firebase data using lists/arrays. For example, ITEMS should be a list with each item of the list containing the properties “name” and “value”.

But this will work with the current formatting:

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

---

<div class="post-metadata">

**Author:** ![igorcastro018ffq0](https://avatars.discourse-cdn.com/v4/letter/i/ba8739/32.png) [@igorcastro018ffq0](https://community.thunkable.com/u/igorcastro018ffq0)\
**Post date:** [April 7, 2022, 7:40pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/16 "2022-04-07T19:40:35Z")

</div>

Thanks! I understand

---

<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:** [April 7, 2022, 8:21pm UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/17 "2022-04-07T20:21:32Z")

</div>

I mistakenly forgot to convert the JSON to an object a couple times. I’ve replaced the screenshot above with the corrected version.

If you want to try out the project, here’s a link:

[https://x.thunkable.com/copy/91af2cc6827a96614264f46017ab6146](https://x.thunkable.com/copy/91af2cc6827a96614264f46017ab6146)

(It’s the first screen and has your username in it.)

---

<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:** [April 8, 2022, 8:10am UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/18 "2022-04-08T08:10:43Z")

</div>

Welcome to Thunkable.

The way you structured your database makes it a bit tricky.

It is hard for me to explain the parts in your structure that makes it difficult to extract but I made a quick demo from your data to show you how this can be achieved.

[https://x.thunkable.com/projectPage/624fe2b0adc8670014f80a10](https://x.thunkable.com/projectPage/624fe2b0adc8670014f80a10)

---

<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:** [July 7, 2022, 8:11am UTC](https://community.thunkable.com/t/import-a-list-from-firebase/1823355/19 "2022-07-07T08:11:39Z")

</div>

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