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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (47,113)