How to use "While" block

Hello
How do i use “While” block for the following case?

I want to keep calling a tag from Firebase while value in not 5

Thanks in advance

1 Like

Hello there! :wave:

Have a look at this :

Hope it helps! :smile:
Thanks! :wink:

Doesn’t this call the database only once when the page opens?
Screenshot_2019-06-22%20Thunkable

This command is the one you should probably be using but I’m not sure I’m using it right in this example,it should, but you first have to add a listener to that specific key.

I never tried this so letme know if it works

1 Like

I would suggest that you use cloud variables instead of the Realtime DB component. It uses Firebase (and your Firebase API key and URL, if you have them set in the your App Settings) behind the scenes but it is much easier to use. Here’s an example of how you might use them to do something when the tag has the value 5:

42%20AM

In this example ‘myVar’ is the Firebase key.

Hope this helps.

-Mark

2 Likes