cancel
Showing results for
Did you mean:

## Lat Long GeoFencing

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

5 REPLIES 5
Super User

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

12.742  * ?

Super User

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

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?

Super User

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)

Announcements

#### It's #MPPC23 Week! Check Out the Community Sessions and Events Happening in Vegas

After all the planning and preparing, the annual Microsoft Power Platform Conference is finally here! We are excited to see so many of our community in Las Vegas this week. To help make sure you don't miss any of the workshops, sessions, and events we have planned, make sure to check out this handy Community One-Sheet, and download the pdf today! Make sure to stop by the Community Lounge to meet @hugobernier, @EricArcher, @heaher_italent, and @AshleyFelts from our team! See you in Vegas!