cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dax
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!

 

 

3 REPLIES 3
yashag2255
Dual Super User II
Dual Super User II

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!
timl
Super User III
Super User III

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.

scottyc87
New Member

@Dax was there a solution for this issue?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,957)