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 / implementation of geo ...
Power Apps
Answered

implementation of geo fencing in check-in and check-out page .

(0) ShareShare
ReportReport
Posted on by 57

i want to know how we can create when we click on check-in button and it is in the radius of geo fencing only than checked in otherwise not ,how can I do this ?

Categories:
  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @Akashdeep ,

    Assuming you set (say) four points of latitude and longitude, you can get the distance from each one with, this will get you the distance in kilometres (just divide by 1,000) - so you can test that they are within whatever distance you want from each point

    With(
     {
     wLat1: YourBoundary1Latitude,
     wLat2: Location.Latitude,
     wLong1: YourBoundary1Longitude
     wLong2: Location.Longitude,
     wCalc: 0.0174532925199432
     },
     12742 * Asin(Sqrt(0.5 - Cos((wLat1 - wLat2) * wCalc)/2 + 
     Cos(wLat1 * wCalc) * Cos(wLat2 * wCalc) * 
     (1 - Cos((wLong1 - wLong2) * wCalc)) / 2))
    )

     

    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.

     

  • Akashdeep Profile Picture
    57 on at

    I am a beginner can u explain it briefly how we can do this step by step ?

  • Verified answer
    WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @Akashdeep ,

    You need to decide how many "points" you want to use and wLat1/wLong1 would become wLat2/wLong2 etc etc. You would set a Variable on each

    UpdateContext(
     {
     varDist1:
     With(
     {
     wLat1: YourBoundary1Latitude,
     wLat2: Location.Latitude,
     wLong1: YourBoundary1Longitude
     wLong2: Location.Longitude,
     wCalc: 17.4532925199432
     },
     12742 * Asin(Sqrt(0.5 - Cos((wLat1 - wLat2) * wCalc)/2 + 
     Cos(wLat1 * wCalc) * Cos(wLat2 * wCalc) * 
     (1 - Cos((wLong1 - wLong2) * wCalc)) / 2))
     )
     }
    )

    so you would have (say) four variables varDist1-4, then test if any of them are bigger than the limit you set, which should be the greatest distance between any two of them.

    UpdateContext(
     {
     varGeoOK:
     varDist1 < YourDistance &&
     varDist2 < YourDistance &&
     varDist3 < YourDistance &&
     varDist4 < YourDistance
     }
    )

    This will return true if OK and false if not. NOTE: I have converted it to metres in the above.

     

    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.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard