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 / How to use Timer contr...
Power Apps
Unanswered

How to use Timer control between patches

(1) ShareShare
ReportReport
Posted on by

I am quite new with powerapps and I am just finishing my first “complex” powerapp solutions. I don’t just get it how to add timer control between 2 patches. I have a button on my App which includes 2 patch to inserts new row on gallery and after that update sum gallery labels to sql on premise. The code looks like this: SubmitForm(Form1_5);;Set(VarStartTimer; true);;Patch('[dbo].[xxx]'; LookUp('[dbo].[xxx]'; ID = Gallery1.Selected.ID); {KPL:Value(Label173_1.Text);EHtm2:Value(Label176_1.Text);Yht:Value(Label175_1.Text)}) P.S. we use ; instead of , like you do in US.

 

On Timer function I use Durations of 5000, OnTimerStart: false, OnTimerEnd: Refresh('[dbo].[xxx]'), Start: VarStartTimer, Repeat:false, Reset:false, Autostart:false, AutoPause:false

 

It works if I add just 1 new record but do not update the second one with Sum labels even I wait more than 5 seconds before next trigger.

Categories:
I have the same question (0)
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Tuukka 

     

    Instead you should do it in one or more Timers only with the variables setting it and put the patches in the OnTimerStart or OnTimerEnd.

     

    It also can work the way you are doing it but you may need to make sure to set the start variable that was set to true and that started the timer back to false at the OnTimerEnd of the Timer itself that is running that is having the issue - this part is tricky and you may need to play with it - that may be why it is only working the first time and not on subsequent times.

     

    For more help on this you can check this example Recipe:

     

    App Timer Wait Recipe 

     

    See if the above recipe helps. Note that above is recipe, not an exact answer to your specific problem. You would still have to adapt it. First check if you can adapt it yourself based on the above recipe - if you try it and after that still have trouble, you can reply here and we might check if we can help you further.

  • Community Power Platform Member Profile Picture
    on at

    Hi, thanks for the tip. I have now tried on both way with no succeed as you mentioned. I checked out your recipe also but I didn't find how to adapt it in this problem. 

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    I finally figured it out. It took some time to play with it. Thanks @poweractivate  I just added UpdateContext({VarStartTimer2: true}) for save button and on the Timer control I put for OnTimeStart my first Patch and on the OnTimerEnd: UpdateContext({VarStartTimer2: false});;Reset(Timer3) and my last patch. For Start On Timer I put VarStartTimer2.  

     

    I did also removing and updating buttons on same way. Works like a charm. 🙂

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard