While/When function on screen start?


I am trying to have a function that waits until a variable does not = 0 and then it triggers.

When variable =>1 do API call etc…

Any advice?

My first thought is to check if the variable does not = 0 whenever you change it. If it is > 0, then call your function.

Would something like this work for you?


Very interesting approach. I am going to tinker with something like that. Thanks for that.

You could also use the clock component for this. Fire every (1 or 2 seconds) and check your variable then.
Hope this helps

1 Like

Just so you know, the next release of Thunkable ✕ will have a ‘when’ block which will execute when a ‘stored’ or ‘app’ variable changes value (or initializes). There is currently such a block for ‘cloud’ variables.

The next version of Thunkable ✕ will be probably be released so after the new year.