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

Using GPS Location to check if at a specfic site stored in a table

Hi some help - I want to use the GPS location feature on the LoginPage of my App, so that it checks the devices LAT/Long and compares it against a Table which contains work locations and if device lat/long is within a radius of one of the tables lat and long, it sets a variable that is that locations WorkLocation. Basically if the users LAT and LONG is within a defined radius of one of the work locations entries in the table they dont need to login, and that location is passed out to be used in the app, if the users lat/long doesnt match any of the tables locations then a variable is set that then requires them to choose a location and also provide login.

 

So Table would have fields for WorkLocation: (a text String) Lattitude: Longitude:

 

Im fairly happy with doing the other elements but how do I compare Location.Lattitude and Location.Logitude against a table and set a variable if there is a match based on a radius (as it unlikley the lat/long will match completely), or output a variable that says user isnt in radius of any of the sites

 

3 REPLIES 3
Super User
Super User

Re: Using GPS Location to check if at a specfic site stored in a table

Rather than using a radius how about recording the location of the facility as a rectangle from NorthWest to SouthEast?  It would be easier to convert the latitude and longitude to two numbers and compare that they are greater than the Northwest corner and less than the SouthEast. That way you know they are within a box centered on the facility.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
JC75
Level: Powered On

Re: Using GPS Location to check if at a specfic site stored in a table

Seems a similar concept however and it’s more about understanding how to complete this weather a radius or a box. Both are in essence a geofenced area. I see this as a really useful example of using a shared device or unique device as a way to get around login issues and protecting data for users where the location( which is already secured) means we could deploy an app that doesn’t really worry about who logged in but that they in the right location, to permit access.
Super User
Super User

Re: Using GPS Location to check if at a specfic site stored in a table

The point is if its a BOX then the comparison is easier to do.  You only have to compare the location latitude is within a range and the location longitude is within a range. The range is set by the latitude and longitude of the NW corner and the SE corner.  That is a much easier calculation than trying to calcuate a radius from a location and see if another entry is within the radius.

 

Or are you asking how you obtain the latitude and longitude from the GPS? Maybe I don't understand the question.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
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

Users Online
Currently online: 187 members 5,573 guests
Please welcome our newest community members: