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 / Selecting a Timer with...
Power Apps
Answered

Selecting a Timer within an If function not triggering the timer to start.

(0) ShareShare
ReportReport
Posted on by 24

Hi I have a Timer that work correctly in that is starts when selected by code in a button. However, if I only want the timer to start on a condition this stops working.

 

Button.OnSelect code is Select(Timer)

Timer.OnSelect = Set(_var_Start_Timer, false); Set(_var_Start_Timer, true)

Timer.Startcode = _var_Start_Timer

 

The above set up works fine but if I change the Button.OnSelect code to

 

If(_var_trigger = 1, Select(Timer), [other code])

 

The timer does not start even when _var_trigger equals 1.

 

Is this a limitation or a bug and are there any workarounds?

 

Many thanks,

 

 

Categories:
  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @Bertiescrepe Make sure that the value of _var_trigger is indeed 1 when you are clicking the button. You can add a Label control to your app and set its Text property to _var_trigger to display the current value.

     

    Then:

    Timer.Start = _var_Start_Timer && (_var_trigger = 1)

     

    Button.OnSelect = If(_var_trigger = 1, UpdateContext({_var_Start_Timer: !_var_Start_Timer}), [other code])

     


    If my reply helped you, please give a 👍 If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it more.

    Visit my Blog: ahmedsalih.blog

    Visit my YouTube Channel: https://www.youtube.com/@powerplatformplace/videos

    Microsoft Business Application MVP

  • Bertiescrepe Profile Picture
    24 on at

    Thank you very much for the quick reply @AhmedSalih this seems to be working with a context variable but also needs to be set in the calling button rather than the OnSelect property of the Timer as you had suggested with your code. The trigger variable was set on app start and never changed so was definitely set to the correct value (I did double check with a label as well). 

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Bertiescrepe, I am glad it worked out. Always happy to help 🙂

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard