How do you pull all data out from firebase and display in table view, any changes to firebase will be synced with table view?

This is how i try to get the all data out from firebase and display in tableview by using List, but the problem is how to synced data if firebase data changed. Besides, the block(code) look like too many and complicated.
Do you guys have any ideas or suggestions to solve??
Thanks in advance :grin:

Block(Code):

Firebase data:
image

Here the output:
image

Set a clock with a timer.

After the specified number of seconds the clock will check the firebase.

Won't work if the app isn't in the background.

You can use Background Tasks Extension as well...


SHUBHAMR69   

Use the DataChanged event ?

1 Like

But i need when the data changed will send notification.

No, it won't work, when i using that's block, the tableview data still be there.

You will need to refresh the Tableview when you get new data with the DataChanged event.

Note: only changes made by the app will be reflected with DataChanged, any changes by other applications or directly in the Firebase Console do not get captured by the DataChanged event. In such an eventuality, then you do need to use a timer or other app event, the call back ALL the data (this could prove expensive with a popular app....)

You mean like this? :thinking:
image

1 Like

No, I mean like this:

image

put this in the Screen1.initialise event.

Then manually fetch the data back from Firebase for the first time. After that, changes to the data should come back through dataChanged.

1 Like