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

Notifications

Announcements

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:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 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
    153,079 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard