Import a list from firebase

I need to make a list importing the properties name and value from firebase. Someone help me please!!!
image

1 Like

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.

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):

1 Like

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

{
"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
}
}
}
}

thanks

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?

Sorry! That’s the correct one:

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.

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

it didn’t work

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!

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.

1 Like

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:

1 Like

Thanks! I understand

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

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

1 Like

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

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