cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
holleman1929
Level: Powered On

From GPS zone to item in database

When a user is at a certain location I want the use to get the details of the project at that location.

I want to use to location functions for it. How do I get from a gps location to the right item in my database?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Meneghino
Level 10

Re: From GPS zone to item in database

Hi @holleman1929

Let's say your database has two numeric columns for the project location: ProjectLatitude and ProjectLongitude.

Then you can calculate the distance to the current user position and show all projects where the distance is smaller than a number that you define.  Because trigonometric formulas will not be delegated, and depending if your projects are global or local, then I suggest that you use the simpler approach. For example the following:

Filter(MyProjects, Abs(ProjectLatitude-Location.Latitude)<X, Abs(ProjectLongitude-Location.Longitude)<Y)

Where X and Y are degress of angle that you have to define depending on how close you want to be before a project shows up.

 

If even Abs is not delegated (i.e. you get the blue circle warning) then just use the following:

Filter(MyProjects,
ProjectLatitude-Location.Latitude<X, ProjectLatitude-Location.Latitude>-X,
ProjectLongitude-Location.Longitude<Y, ProjectLongitude-Location.Longitude>-Y
)

Please let me know if this helps.

 

 

View solution in original post

holleman1929
Level: Powered On

Re: From GPS zone to item in database

Thank you for this solution. I will test this the coming week and will let you know the outcome.

I will test both solutions. My preference is the second solution for it is more accurate.

View solution in original post

2 REPLIES 2
Meneghino
Level 10

Re: From GPS zone to item in database

Hi @holleman1929

Let's say your database has two numeric columns for the project location: ProjectLatitude and ProjectLongitude.

Then you can calculate the distance to the current user position and show all projects where the distance is smaller than a number that you define.  Because trigonometric formulas will not be delegated, and depending if your projects are global or local, then I suggest that you use the simpler approach. For example the following:

Filter(MyProjects, Abs(ProjectLatitude-Location.Latitude)<X, Abs(ProjectLongitude-Location.Longitude)<Y)

Where X and Y are degress of angle that you have to define depending on how close you want to be before a project shows up.

 

If even Abs is not delegated (i.e. you get the blue circle warning) then just use the following:

Filter(MyProjects,
ProjectLatitude-Location.Latitude<X, ProjectLatitude-Location.Latitude>-X,
ProjectLongitude-Location.Longitude<Y, ProjectLongitude-Location.Longitude>-Y
)

Please let me know if this helps.

 

 

View solution in original post

holleman1929
Level: Powered On

Re: From GPS zone to item in database

Thank you for this solution. I will test this the coming week and will let you know the outcome.

I will test both solutions. My preference is the second solution for it is more accurate.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 331 members 5,623 guests
Recent signins:
Please welcome our newest community members: