Automatic Page Redirect with Timer

Navigate Between Screens

The Navigate function is used to navigate between screens in PowerApps mobile apps. Navigation between screens can be done when the objects are touched/clicked(by the trigger of user) or within a certain period of time(with a timer). In our previous article, we navigated by writing a formula into the OnSelect property of a button. In this article, we will automatically navigate after a while.

Timer

You can use the Timer object for each action that will be executed based on a duration. This way, when the time start or ends, it will be run to be applied on the actions you’ve determined. Timer works here as a trigger (It is a word that we use a lot in our Power Automate articles). It starts for the time to be up and starts the flow.

Timer objects has properties like OnTimerStart, OnTimerEnd, Duration, Repeat, and Reset and actions are executed with these properties. You can take a look at the general features of Timer here.

For example, you can display a text and image that states uploading/saving/wait etc. You can start the page redirect when it’s OnTimerEnd.

When it’s OnTimerStart and OnTimerEnd, you can create a collection. You can create or compare conditions.

Navigate

Let’s make an example where we see a screen with the “Saved successfully” text after saving and when the duration is done we go back to the main page.

Two screens need to be added into the application. Let’s call one of the screens SCR_Mainpage , and SCR_Action_Successful the other.

Timer object will be added to the SCR_Action_Successful page.

Duration property of the Timer objects writes in milliseconds, and this indicates the duration of the times. When you add a timer, standard Duration comes as 60 000 and it indicated 60 seconds. Which means that when the timer start from 1 and end with 60, it will start the actions.

Let’s make the Duration 3000 and get the action done in 3 seconds in order not to wait for too long and to see the results faster.

Duration: 3000

When the specified time of 3 seconds ends, we’ll be redirected to the main page.

OnTimerEnd: Navigate(SCR_Mainpage)

It was set as true in order for the timer to start automatically.

AutoStart: true

After these actions, the timer works actively. If you want, you can hide the time by setting the Visible property as Visible.