I can't get value from firebase

while i trying to get data from realtime database, my screen just all turn to this.


what should do to fix this bug?

And this is my code.

1 Like

Hi, @D.J_TRUMP! :wave:


This could help you find the bug -

In your RealtimeDB.get() block, (in the if statement), add an else block. and set a label’s text to error

:arrow_right: Pseudocode -

realTimeDB.get( key ) {
     if (not error) {
            listViewer1.items = list;
     } else {
            label1.text = error;
     }
}

Hope I helped you! :smile:

Thanks! :blush:

@kartik14 sorry it doesn’t work, it still the same error here. after opening my app for a second, then it just turned to empty screen. Is the my getting value’s code correct?

there is nothing wrong on your code is just that firebase works a bit different on thunkable X like example…

when you ask for true or false from firebase it would just read it as a text and no as a boolean

and it also doesn’t detect list … so you have to save the list as a text csv (comma , separate value) and when you ask for the list you’ll have to convert the text into a list with the block “make lis from text”

I don’t know if they fixed this it seems like it doesn’t other wise you wouldn’t make this post

but working with objects in firebase is a lot better than working with list it gives you more possibilities , take a look at that

1 Like