How do you retrieve data from firebase when screen is open?

image

Do you want to update the existing data/values?

Then just call your data from firebase again, using the routine you already used ?

You could use a clock timer to do this automatically at set time intervals, or provide a button for the user to refresh values.

2 Likes

I don't want to update that value. I just want to show the value.

Show your relevant blocks

Also
http://ai2.appinventor.mit.edu/reference/components/experimental.html

http://ai2.appinventor.mit.edu/reference/other/firebaseIntro.html


I want to display the first value available in firebase if no value is null

image

image

1 Like

Most probably you are missing a / before 03 .Url address should be

https://firebase's url/03/MAX_WATER.json

I would suggest that you setup your data using the date (formatted alphanumerically - 2022-05-04) as the tag, then you can easily retrieve the latest data.

You should only need to make one call to retrieve all the data under that tag, then you can access the individual elements to apply to your app.

2 Likes

If there is no 03 value, how can I show another value?

1 Like

Get the taglist first, then select a tag, then get the data.

2 Likes

Can you show the block structure? I tried to do this but I can't.

1 Like

Something like this:

image

image

3 Likes

Thank you very much :smiling_face_with_three_hearts: