web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Timer Control with a b...
Power Apps
Unanswered

Timer Control with a button

(0) ShareShare
ReportReport
Posted on by
I have an audit program. Here I say start the control with the button. That's when I want to start the timer. There are 10 screens in between. Finally, I go to the end check screen. Here the audit is over ... I want to show it as seconds left. I defined it as a global variable, but it didn't run. How can I do it?
 
First I tried a set function on the start screen on start. Set(varAutoStart, true)
After Button click on start Set(varAutoStart, false).
Set the AutoStart property to a variable varAutoStart.
 
 
Categories:
I have the same question (0)
  • MVP-Phipps Profile Picture
    3,508 Super User 2024 Season 1 on at

    On App On Start Property: Set(varAutoStart, false)

    On Select on Button Property: Set(varAutoStart, true)

    Set the AutoStart of the Timer to varAutoStart

     

    This will work, I have tried it. You were almost there, just your true and false was the wrong way round.

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Community Power Platform Member Profile Picture
    on at

    Actually it didn't work the way I wanted. Because I want the time to start when I click the button, but it starts when I enter the screen like this. So I am opened new opinion

  • MVP-Phipps Profile Picture
    3,508 Super User 2024 Season 1 on at

    When the button is clicked, that sets a variable. The autostart of the timer will not begin until that variable is set. Then on the time end, set the variable to false. I have it working in my app exactly like this.

  • Community Power Platform Member Profile Picture
    on at

    I understand, but my main goal is to let the timer start in the background when the user clicks the button and see how long the user has left in the timer when the user comes to the last screen. For example, if the timer is set to 3 minutes, another button should be active at the end of the 3rd minute.

  • MVP-Phipps Profile Picture
    3,508 Super User 2024 Season 1 on at

    So you can set the AutoEnd Property to set a variable. Then on the button that should be active at the end of the 3rd minute, set the visible property to your new variable that has been set by the timer.

     

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Community Power Platform Member Profile Picture
    on at

    Yes actually the last part is correctly run. Just I couldn't start to timer. When I came the final screen, timer is starting but it is starting to count 3 minutes. For example,I spent 2 minutes in the program. When I get to the final screen, I want it to show me because there is 1 minute left. But now When I get to the final screen, it show me 3 minutes left.

    Thank you for replying and your interest 🙂

  • MVP-Phipps Profile Picture
    3,508 Super User 2024 Season 1 on at

    This is how I would do this:

    On Visible of first screen set a variable. Use that variable on the auto on start of the timer. On the last screen, on visible property set another variable and add that variable to the auto pause. Then that should leave the time remaining. Set the duration of the timer to 3 mins. On the time auto end, set a variable for you to use on the visible property of your other button.

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Verified answer
    iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Timers aren't reliable when you aren't on the screen they are on (multiple experiences of issues with this).

     

    I would instead set a few variables when the audit starts:

     

    Set(gblAuditTimeStart, Now());
    
    Set(gblAuditTimeEnd, DateAdd(gblAuditTimeStart, 3, Minutes));
    
    Set(TodayDateTime, DateTimeValue(Text(Today())));
    
    Set(gblAuditTimeRemaining, gblAuditTimeEnd-Now());
    
    Set(TimeRemainingText, Text((TodayDateTime + gblAuditTimeRemaining), "mm:ss"));
    
    Navigate(Screen2);

     

    Then you have a time on each screen that runs every 1 second, it updates the value of the time remaining:

    Set(gblAuditTimeRemaining, gblAuditTimeEnd-Now());
    
    Set(TimeRemainingText, Text((TodayDateTime + gblAuditTimeRemaining), "mm:ss"));

     

    Then you can have a label on each screen letting them know how much time is remaining, and as a bonus we can disable the button when the time remaining expires ie when end time is less than Now()

     

    I've attached a proof of concept App to show what I mean,

     

    Cheers,

  • Community Power Platform Member Profile Picture
    on at

    Yees, thank you for reply. It worked 🙂 

  • Community Power Platform Member Profile Picture
    on at

    Hey, I tried and it worked correctly but now I have an also problem. I tried to bonus information and it worked too. My formulas is on the button visible section and I use the formula like this. If(TimeRemainingText="00:00";true). At first it worked but after the 1 seconds the button disappeared again. I want to stop when TimeRemainingText="00:00".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard