web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need to verify GPS Ran...
Power Apps
Unanswered

Need to verify GPS Range for Attendance APP

(0) ShareShare
ReportReport
Posted on by 2

hello,

 

I have built an app that gathers Employees Time in / Out in sharepoint list what im trying to do next is to get GPS coordinates of the employee and compare it with a range of coordinates to see if the Location is coming within the range and if yes then i need to update a boolean value through it.

 

I am also attaching pictures of the app, SharePoint Columns and GPS coordinates Sharepoint Lists ColumnsSharepoint Lists ColumnsApp ViewApp ViewMap range that coordinates need to be withinMap range that coordinates need to be within

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,110 Most Valuable Professional on at

    Hi @SaadSami ,

    The built-in functions Location.Latitude and Location.Longitude will get you the user's current location provided they have allowed Power Apps to access this (they are asked when opening the app. You will have to decide what difference to your reference coordinates is acceptable for your setting.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • SaadSami Profile Picture
    2 on at

    i have already put those commands in place and i have current GPS coordinates but i need to compare current coordinates with a range of coordinates, how do i do that?

  • WarrenBelz Profile Picture
    156,110 Most Valuable Professional on at

    @SaadSami ,

    It is really mathematics rather than coding. you need to decide what difference (it will be several decimal places) in both Latitude and Longitude is acceptable.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Hi @SaadSami ,

     

    I propose a different approach to the problem, that's because it's quite difficult to check the current position of a mobile device relative to 4 geographical points.

    My solution is to set a single point (preferably on centre of your building / area) and check the distance from the mobile device to that point. In this way you obtain a circular area around your point.

    gabibalaban_0-1603712773855.png

     

     Formula to get the distance between two points having the geographical coordinates (i'm not assuming any credit for this, but it worked extremely accurate in my case) is :

     

    12742 * Asin(Sqrt(0.5 - Cos((Latitude - lat1) * 0.0174532925199432)/2 + Cos(lat1 * 0.0174532925199432) * Cos(Latitude * 0.0174532925199432) * (1 - Cos((Longitude - lon1) * 0.0174532925199432)) / 2)) * 1000

     

    where lon1 and lat1are the mobile device coordinates and Latitude and Longitude are the building coordinates.

  • WarrenBelz Profile Picture
    156,110 Most Valuable Professional on at

    @SaadSami ,

    I have not done trigonometry for more years than I can admit (I thought calculators killed in in the 70's . . .). If it works, go for it.

  • hurodriguez Profile Picture
    2 on at

    Take a look at this code, remember to add bing maps. You just have to define what distance. 

     

    MapasdeBing.GetRoute("Longitude-mobile-device, Latitude-mobile-device"; "Longitude-building, Latitude-building";{distanceUnit:"Kilometer";optimize:"distance"}).travelDistance

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard