cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
roncam
Helper II
Helper II

get gps coordinates

i need to have a button when press ill get the gps coordinates in a datacard text input

 

can you hel please ?

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Set a button with variables:

 

UpdateContext({var_currentLat: Location.Latitude})
;;
UpdateContext({var_currentLong: Location.Longitude})

 

And a label text property :

 

"Latitude: " & var_currentLat & " Long" & var_currentLong

 

Press the button see if it works

View solution in original post

3 REPLIES 3
CarlosFigueira
Power Apps
Power Apps

You can set a variable with the GPS coordinates (using the Location signal), and set the Default property of the text input control to use that variable. For example, if you set this expression to the button's OnSelect property:

UpdateContext({lat: Location.Latitude, lng: Location.Longitude})

And you set the Default property of the text input control to

lat & "," & lng

Then when you press the button the coordinates will be shown in the text input control.

Anonymous
Not applicable

Set a button with variables:

 

UpdateContext({var_currentLat: Location.Latitude})
;;
UpdateContext({var_currentLong: Location.Longitude})

 

And a label text property :

 

"Latitude: " & var_currentLat & " Long" & var_currentLong

 

Press the button see if it works

Anonymous
Not applicable

This gives me My coordinates.

What if i want coordinates of another user in my organization.

 

something like :

Office365Users.UserProfileV2("abc@xyz.com").Location.Latitude

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,010)