Refreshing a page after X time

Hello,

Let me give you some context: I created an app through Bubble.io to show ads.

So let’s say my database now contains of 3 ads.

Each AD has a “refresh rate” of seconds.

Let’s say one AD has the refresh rate = 10 seconds.

the 2nd AD has the refresh rate = 20 seconds.

and the 3rd AD has the refresh rate = 5 seconds.

I need to find a way to refresh the page based on the ads’ refresh rate. but i don’t seem to be able to come up with a way of doing this.

__

What i’ve done so far: (and is not really working)

Each of my ads also has a “run-time-counter” - every 5 seconds my app adds to the “run-time-counter” the initial value + 5.

When “run-time-counter” = “refresh rate”, then the page is refreshed, and also the “run-time-counter” is set back to zero.

This works GREAT when you only use ONE screen. As soon as I add another screen (or six!) things stop working … (and I get it why).

Anybody got a good idea about this?

Thanks so much!

Hi @ariel.constantinof :wave:

Download the TimeCheck plugin. It is a timer.

image

You can set a dynamic value for the timer (Your ad’s refresh rate) and trigger an action when the timer finish (in your case, refresh).

Hello - thanks for your answer.

It seemed logic at first, but i’m not sure how to make it wrong.

I dragged the plugin icon to the right place and set the number of miliseconds i needed the ad to run.

In Workflows i created the “If condition is true” → Refresh.

But i can only get Timer A’s getstring - and I have no clue how to work with this.

If it’s a timer I set it to getstring=0 (the logic being that it’s a timer going from X to zero.)

When =0, refresh. But it doesnt work.

Any ideas? Thanks again!

The workaround i found so far was to hold the “run-time-counter” under the User, and not under the AD, … and then every screen I use has a different user logged in … things work fine. :slight_smile:

Any better ideas?

After you insert the timer in your stage you will have a new trigger in your workflow:

image

:sweat_smile:

Have you tried the “schedule a custom event” action? You can dynamically set the duration.
image

1 Like

I have found all timers from plugins to be extremely unreliable and buggy and suggest you follow @ihsanzainal84’s idea and use Bubble’s built in timer in scheduling custom events