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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Time control with a bu...
Power Apps
Unanswered

Time control with a button on another screen

(1) ShareShare
ReportReport
Posted on by 5

Hi all,

 

The title pretty much says it all - i got a button on screen1 that i want to start a timer on screen 2 (without navigating to screen2)

I'm aware both screens have to be active at the same time for it to work, but i cant figure out the combination of Set and global settings.

 

All input greatly appreciated!

Thanks

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi

     

    You can achieve this by using a global variable to store the start time of the timer other screens.

     

    On Screen 1, add a button and set its OnSelect property to UpdateContext({StartTimer: true}). This will set the value of the global variable to true when the button is clicked.

     

    On Screen 2, set the AutoStart property of the Timer control to StartTimer. This will start the timer when the value of the global variable is true.

     

    Optionally, you can add actions to perform when the timer finishes running by setting the OnTimerEnd property of the Timer control.

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

  • RMCoder Profile Picture
    219 on at

    It should be as simple as setting a Boolean variable with your button, and then using that variable in the Start property of your timer.

     

    Here's an extremely simple example:

     

    Controls used: Button, Timer, Label (to show the timer value)

    RMCoder_0-1692886503900.png

     

    This is the OnSelect property of my button:

    Reset(Timer1); Set(var_StartTimer, false); Set(var_StartTimer, true);

    RMCoder_1-1692886569175.png

     

    I'm resetting the Timer1 control and my var_StartTime global variable in the same place for ease of testing. In your app you may only have the last command, Set(someVariable, true).

     

     

    I left the timer unchanged, except for its Start property, I set it to the variable changed by Button1:

    RMCoder_3-1692886949210.png

     

     

    Hope that helps!


    Please mark this as a solution if I answered your question 🙂

  • RMCoder Profile Picture
    219 on at

    Clearing up Rajkumar's answer in case anyone reads it later.

    Context variables are scoped to the screen  (local variables), so the other screens won't be aware of it and you will get a formula-level error. 

     

    The AutoStart property of a timer controls whether the timer begins automatically when the screen becomes visible.

  • Azalia Profile Picture
    2 on at

    You could set the OnHidden property of the screen where the timer is as Set(var_StartTimer, var_StartTimerfromButton) and set the OnSelect property of the button on the other screen with Set(var_StartTimerfromButton, true) and then for the last you set the autostart property of the timer as var_StartTimer.

    This should work, but first, you must go through the screen where the timer is then go to the screen where the button is and click it. If you must go through the screen where the timer is in, its better to place the timer on the home screen, because you always and must see the home screen first as you play the app.

    This is the best workaround that I could suggest to you, I don't know if it help though.
    You could ask me if you don't understand this instruction.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard