cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

How to continuously track location? Or automaticly every 30 seconds.

Hi knowledgable people,

 

I'm new to PowerApps, have only been working with it for 2 days. I work at a municipality. We have a big event coming up, expecting 75.000 visitors. We will have about 500 coworkers everywhere in town, and want to know where they are. So I thought I’d use PowerApps to collect their GPS, send it to an Excel file, and make a Power BI map.

Using the Site Inspection template, I can now send a form from my phone that includes GPS. I've plotted my form entries on a Power BI map. So far, so good!

The next step is to continuously track my location: have the app send my GPS coordinates to my file without pushing the button. Preferably every 30 seconds.

Also, if you have advise on this other issue, I’d love to hear it. I’d like to store the collected data in our Azure Data Lake Store (instead of my OneDrive), but cannot find this option. Is there a workaround?

THANK YOU!

 

 

2 REPLIES 2
Highlighted
Dual Super User III
Dual Super User III

Re: How to continuously track location? Or automaticly every 30 seconds.

Hi @Dax 

 

For doing so, you can add a timer to your screen and set its properties as:
 
Repeat: true
OnTimerStart: Refresh(Table1);If(IsBlank(LookUp(Table1,Name = User().FullName).Name),Patch(Table1,Defaults(Table1),{Name:User().FullName,Latitude:Location.Latitude,Longitude:Location.Longitude}),Patch(Table1,LookUp(Table1,Name = User().FullName),{Latitude:Location.Latitude,Longitude:Location.Longitude}))
AutoStart: true
Duration : 30000 (30 seconds)
 
Here, Table1 refers to the datasource (in this case, an excel table with atrributes Name, Latitude and Longitude). There is a if condition on TimerStart, which checks if the person's name exist then it will update the record, else it will create a new record for new users.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Highlighted
Super User
Super User

Re: How to continuously track location? Or automaticly every 30 seconds.

Hi @Dax 

Although you can record GPS locations on a timer as @yashag2255  suggests, I don't think that this is a practical solution for what you want to accomplish.

The problem is that when a mobile device goes into screen lock mode or goes to sleep, PowerApps will not run the code or record the locations. Therefore, the devices that your co-workers use must be fully switched on with PowerApps running in the foreground throughout the entire duration for this approach to work.

As far as know, there is currently no work-around for collecting locations in the background.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,465)