cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
imaliasad
Level: Powered On

Get GPS Location after every one hour

Hi everyone, I'm trying to develop a timesheet app on power app where I have a requirement to save user's GPS location every 1 hour automatically. I'd really appreciate if someone shares any possibility in powerapp to trigger a method automatically without the internet so, I could save user GPS location for every 1 hour. Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
myke_deabreu
Level 8

Re: Get GPS Location after every one hour

Hi Imaliasad,

 

This maybe tricky as I believe the PowerApp will need to be open. If that is the case you could setup a timer that every hour it does the following:

 

Timer Settings:

 

Duration: 3600000 (timer is in milliseconds)
AutoStart: true

OnTimerEnd: Patch(datasource,defaults(datasource),{longitude:Location.Longitude,latitude:Location.Latitude})

 

Using the Location function it will pull the devices GPS information (Provided location services is activated). Also, the above will only work when the PowerApp is launched. I do not believe these can be done in the background with PowerApps (I could be wrong but 99% sure).
 

View solution in original post

4 REPLIES 4
myke_deabreu
Level 8

Re: Get GPS Location after every one hour

Hi Imaliasad,

 

This maybe tricky as I believe the PowerApp will need to be open. If that is the case you could setup a timer that every hour it does the following:

 

Timer Settings:

 

Duration: 3600000 (timer is in milliseconds)
AutoStart: true

OnTimerEnd: Patch(datasource,defaults(datasource),{longitude:Location.Longitude,latitude:Location.Latitude})

 

Using the Location function it will pull the devices GPS information (Provided location services is activated). Also, the above will only work when the PowerApp is launched. I do not believe these can be done in the background with PowerApps (I could be wrong but 99% sure).
 

View solution in original post

imaliasad
Level: Powered On

Re: Get GPS Location after every one hour

hi @myke_deabreu, thank you very much for your detailed reply. I was hoping to find out some function which runs in the background so the user won't need to open the powerapp every single time to update their GPS location. The solution you provide is the alternative to background functions I suppose. I'll try that out, meanwhile, I'll be waiting for more response from others. Thank you very much, I'll mark this reply as answer once I test it 🙂

Highlighted
myke_deabreu
Level 8

Re: Get GPS Location after every one hour

Here was a similar request and it was mentioned it was not possible either.

 

https://powerusers.microsoft.com/t5/General-Discussion/Canvas-app-on-mobile-device-not-updating-the-...

SoB
Level: Powered On

Re: Get GPS Location after every one hour

This gives me My coordinates.

What if i want coordinates of another user in my organization.

 

something like :

Office365Users.UserProfileV2("abc@xyz.com").Location.Latitude

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,165)