cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Dax
Level: Power Up

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
Dual Super User
Dual Super User

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!
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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 4 members 6,448 guests
Please welcome our newest community members: