cancel
Showing results for 
Search instead for 
Did you mean: 

Timer Control Running In Background

Can we get the timer control allowed to continue running on a mobile device even when another application is opened instead of powerapps.  Ive built an app that tracks the GPS of the device a specific intervals based on other data within the app, it works fine as the scheduled refresh using a function against OnTimerEnd. However this only works if PowerApps is the open application, if you dont close PowerApps but switch to another application the Timer is paused until you make PowerApps the visible application on the device where it then resumes from where it was up to. 

 

Is there therefore any way to allow the timer control to continue running providing the PowerApps application on the device is not closed down, so its either open and in view or open in the background.

 

Thank you

Status: New
Comments
WPB
Level 8

Would be awesome to be able to create threads that would run like a service!

The best example would be to have something like MileIQ but, it would put the time and mileage in the right project without any interpretation (Exports, data analysis and imports...)!

Level 10

This is absolutely requisite for mobile GPS tracking apps. Please enable this asap.

Level: Powered On

im having similar problem that when i change the app or page on display on my computer, the timer stops and resume when powerapps is the app or page on display again

 

can someone help on this. i need urgent support, as i have to meet a deadline at work. i would really appreciate urgent assistance Smiley Happy

WPB
Level 8

The solution: 

Set(StartTime, Now())

In the timer that repeats every second: 

Set(Now, Now())

In a label: 

Text(Time(0, 0, DateDiff(StartTime,Now,Seconds)), "[$-en-US]hh:mm:ss")

 

That way, you don't need the timer to count the time, you use a variable and the difference between the StartTime variable and the Now variable.

 

Level 10

Hi @annaszakir . That is a good idea for tracking durations between events. The challenge I'm having is: I want to trigger events on a set schedule at all times.

Example: Report Lat/Long every 10 secs.

If the app is closed/phone asleep, no timer runs, no reporting occurs.

Level: Powered On

I want to build a countdown-timer that alerts me. But of course would be on a different screen while doing that. 

Hard to believe that this isn't possible, currently. 

Or did I miss sth here?

Level 10

Hi @Imke ,
As long as the PowerApp is open on the device, you can likely pass time variables between screens easily using Set().

The problem i'm surfacing arises when the users device goes to sleep or the user closes the PowerApp container app on their device.

Pop over to the General forum to post a question about how to accomplish a timer across screens.
Take care.