cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JayFernback
Level: Powered On

"Freeze" GPS Information

Hi,

 

I'm working on an app to capture photos and submit them to an excel file in a onedrive location. After taking the picture, the user needs to give the picture a name, and click a Submit button. The excel is then populated with the path where the picture is stored, the name given by the user, the timestamp, and the gps information.

 

The problem is that I'm getting unrealistic data because if the user is moving (let's say he is taking pictures while riding the bus) the GPS data keeps updating while the user is filling the form, and the coordinates that he submits are the ones when he pressed the Submit button, and not the ones when he took the picture.

Is there any way to keep the gps data static once the picture has been taken? Maybe copying the coordinates from one textbox to another one as plain text or something similar? I really can't think of anything.

 

Any ideas will be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff murali
PowerApps Staff

Re: "Freeze" GPS Information

You could save off the image and the associated gps information in a context variable/collection of some sort.

 

UpdateContext({Pic: ..., Position: {Latitude: Location.Latitude, Longitude: Location.Longitude}})

 

and then when the user clicks on Submit, get the information from the context variable

 

Hope this helps

 

Thanks

Murali

5 REPLIES 5
PowerApps Staff murali
PowerApps Staff

Re: "Freeze" GPS Information

You could save off the image and the associated gps information in a context variable/collection of some sort.

 

UpdateContext({Pic: ..., Position: {Latitude: Location.Latitude, Longitude: Location.Longitude}})

 

and then when the user clicks on Submit, get the information from the context variable

 

Hope this helps

 

Thanks

Murali

JayFernback
Level: Powered On

Re: "Freeze" GPS Information

Thanks a lot Murali. Worked perfectly.

Anonymous
Not applicable

Re: "Freeze" GPS Information

Hi Murali,

 

Why I am not able to see any numbers when I gave Location.Latitude in a text box?

 

Do I need to enable something?

 

Capture.PNG

 

Meneghino
Level 10

Re: "Freeze" GPS Information

Hi @Anonymous, you only see this information when you run the app on a moblie device with GPS enabled.

You will not see any information in PowerApps studio.

luuminhvuong93
Level: Powered On

Re: "Freeze" GPS Information

@Meneghino for a user sometimes they enabled GPS but it is still missing at times (some data has GPS, some data doesnt)

what could have been the issue?

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

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