cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JhonatanOB1993
Helper II
Helper II

Enable button in a geolocation range

Good morning to everybody.

Please, could you help me with the following query, it is about a case that we would like to solve in the company. We need to control the entry and exit marks of the workers. For this, the ideal would be for them to register through power apps to indicate that they have already arrived at the company, but we would like a button to be enabled when they are within a range close to the company's location. Also, if you are working remotely, this button must be enabled by means of some permission.

I remain attentive to your suggestions.

Have a nice weekend!

Cheers,

Jhonatan Ora Badillo
2 REPLIES 2
AhmedSalih
Solution Sage
Solution Sage

@JhonatanOB1993, Hi there, while I don't have a tested solution, but I would start by getting the Longitude and Latitude of the Center of the workplace. Once you have them, set Local variables where you have that button, and use something like the below formula in the DisplayMode property of that button:

(Note: assuming varWorkPlaceX for Latitude and varWorkPlaceY for Longitude)

 

If(Abs(Location.Latitude)/Abs(varWorkPlaceX) <= 1 && Abs(Location.Longitude)/Abs(varWorkPlaceY) <= 1, DisplayMode.Edit,DisplayMode.Disabled)

 

For more information about the Location function: https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/signals#location

 

 

Regards,
Ahmed
If my reply helped you, please give a 👍. And if it has solved your issue, please consider Accept it as the Solution to help other members in the community find it more.

Thanks for your answer, @AhmedSalih

 

I'll try do it.

 

Regards,

 

Jhonatan Ora Badillo

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,045)