Firebase storage and database - how to check if the app have all the data

Hi,
for some time I’m trying to find the best way to solve the issue of synchronize getting data from Firebase Storage and Database. To give a better undersatnig of the problem: my app presents some data in the form of a Expandable ListView (Expandable ListView Extension for Kodular , Thunkable , Appybuilder - YouTube). To build the list I use data from Firebase Database, for the images I use Firebase Storage (with the external extention: [Free] FirebaseStorage Extension v2.0 (New Version) - ClassicExtensions - Community). Everything in the test mode worked fine so I exported the apk and instaled it on my phone - and the problems began.
First run and I got runtime error with not much a message/code but I’ve manage to corect the app by forcing to get the data in the order of clicking some button. I realized that acctualliy on the phone I can have very bad internet connection so the answe from the storage and database can be different and need to be sure that I have all the data before buiding the list. The problem is that I have only blocks: “When Firebase Database Got Value” and “When Firebase Storage Response” and they cant be triggered in some order - I need to what for them. Of course I could set some counter for each call, but the number of times I call database and storage is not equal (I call with function: for each). So finally my question is:

How to check if the app got all the data from calling Firebase Database and Storage?

Hello Abdrzej_J , A very warm welcome to kodular community
Can you please share the reference blocks for much more better answer ?

I know that firebase database sometime takes a while as in my recent project it was taking a while longer so i am now using airtable hope using that will give you faster results in bad internet conditions

Hi rudresh_rajvansh,
thank you for fast respons, hear are the simplified blocks:

The problem is with the PROCESING that uses values that are from Firebase Database and Storage. I don’t know how to check if the app has all the data from Firebase.

As for the Airtable I’ll have a look, but I like the JSON style of data structure in Firebase, and I’m quite sure that in real life we can have different quality of internet connection so this type of check should can be usefull.

You can use if else to check that url value tag is empty or not

I have a another way to do this when screen initialize call F_DB and when you got data from firebase database call F_S and when firebase storage response call PROCESING this will help you to get data efficiently and you will have all data at the end

Hope it will help you
@Andrzej_J

The thing is that I need to wait for all the data - I’m calling Firebase for each item in the LIST, and with setting the trigger when I get the first data the whole logic is not working.

You can use notifier when got data send alert got data

You have in mind the standard notifier function?


I’m looking at the docs and can’t find the way how this might help? Can you be more specific?

There is a block in notifier


You will find this block

But this will just display the alert, I don’t need to inform the user :wink: I just need to be sure that Firebase Databes and Storage responed for all my calls (for all the item in the list).

The got data block which you are using will ensure that your app got the data and the firebase storage response will ensure you got url you just use if else in firebase storage block to ensure that they have got data

Simple “if else” will pass the flow after the first respond but I need to have all the data.
I’m starting to think that I’ll have to count the number of calls and the replies.