This Power Apps tutorial will walk you through numerous examples of how to use the Timer control within apps.

PowerApps Timer Control

The “Timer” function in Power Apps analyses how your software performs after a predetermined amount of time.

Its duration property defines the length of time in milliseconds that the PowerApps timer will operate. The default duration is 60 seconds, while the maximum duration is 24 hours.

Add a Timer control to Power Apps.

Here, we’ll look at the location of the Power Apps timer control and how to add it to the Power Apps screen.

The instructions listed below should help you locate the Power Apps Timer Control:

  Select the Insert tab, Input, and Timer options on the Power Apps screen.
  Choose the control. It will appear on the screen as shown below:

When the control is added, we can see that the duration is by default set to 60000. This translates to 60000 milliseconds = 60 seconds, which can be extended to 24 hours.

This is how to add a timer control to the Power Apps screen.

Control the timer with Power Apps.

When a user clicks the timer, a countdown based on the chosen time period starts. For instance, the timer will give a countdown of 5,4,3,2,1 if the duration is 5 seconds.

The steps to work with this requirement are as follows:

  Add a timer control to the Power Apps panel.
  Make the Duration 10000. (10 seconds).

 Place a Label control below the timer control on the screen.
  In the Label control’s Text property, enter the expression shown below.

“*Time: ” & RoundUp(10 – Timer.Value/1000, 0)

Where Timer refers to the Power Apps Timer control.

Then, on the Power Apps Timer control, set the Repeat and AutoStart values to true. As a result, the timer will start playing automatically and will repeat the duration once the timer expires.

Autostart = True

Repeat = True

That’s all! For the time being, save and preview the app. When we click on the timer control, the seconds and remaining time are displayed in the label control shown below:

Because the overall length is 10 seconds, the remaining seconds are displayed as 6 seconds. This is how the Power Apps Timer countdown works.

Button initiates Power Apps Timer control.

We’ll begin with a button and go to the Power Apps Timer control. That is, when the user presses the button, the Power Apps timer control is activated.

The following steps are required to work with this requirement:

  1. In the Power Apps screen, add a Timer control.
  2. Set the Duration property to ten thousand.
  3. Add a button control to the screen and rename it Start.
  4. On the button’s OnSelect property, enter the expression shown below.

OnSelect = UpdateContext({startTimer:true});

Set the updatecontext variable name, i.e., startTimer, on the Power Apps Timer control’s Start property.

Power Apps Timer Control Stop

We’ll look at how to use a button to stop or pause the Power Apps Timer control.

  1. Place a button control near the start button on the screen.
  2. Change the button’s name to Stop.
  3. Add the following expression to the button’s OnSelect property to stop the timer control while it is running.

UpdateContext({startTimer:false});

The name of the update context variable established in the preceding example is startTimer. Change the variable’s value to false.

When you first start the timer, it may not operate in some circumstances. Stop the timer and then restart it in this situation. Then it will work properly.

This is how to use a button in Power Apps to end a running timer control.