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 / Lat Long GeoFencing
Power Apps
Unanswered

Lat Long GeoFencing

(0) ShareShare
ReportReport
Posted on by 416

I am creating a attendance app and want to know if users lat long is within certain radius then make field true

 

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

    Hi @Himanshu_90677 ,

    This should get you metres from the point identified

    With(
     {
     wLat1: YourTargetLatitude,
     wLat2: Location.Latitude,
     wLong1: YourTargetLongitude,
     wLong2: Location.Longitude,
     wCalc: 0.0174532925199432
     },
     12.742 * 
     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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Himanshu_90677 Profile Picture
    416 on at

    12.742  * ? 

  • WarrenBelz Profile Picture
    154,393 Most Valuable Professional on at

    @Himanshu_90677 ,

    What is the question ? That is the formula you need for metres.

  • Himanshu_90677 Profile Picture
    416 on at

    Okay so its worked but i have 2 component and both give me different lat and long its radius is set to kilometers i want value to true or false based on if distance < radius

    does this work as expected?

    Thank you for your reply

  • WarrenBelz Profile Picture
    154,393 Most Valuable Professional on at

    @Himanshu_90677 ,

    Sorry, I do not understand your question - you simply need to have your desired radius as the criteria for true of false if it is greater than or less then - what is the actual code you are using in Text please)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#2
Haque Profile Picture

Haque 69

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard