cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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.

 

 

Highlighted
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.

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.

 

 

Highlighted
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.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 61 members 4,874 guests
Please welcome our newest community members: