cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

Hi @Anonymous 

 

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

Hi @Anonymous 

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

@Anonymous was there a solution for this issue?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,190)