So you can use this to measure from where Here() reports you at to where the phones GPS says you are
But as with everything in Appsheet Distance() can only run when the user does something in Appsheet. So you could, in theory, set up Appsheet to check this for every add/edit/save/delete on all table records.
A better way to do this is to try and structure your App so the user has to do something when and where you want to check where they are. The main usage case for me is that we do a lot of timesheet systems. So we want them to clock in and out when the get to and leave site. I do this with two DateTime columns. Then next to each I have a Change Location column watching these. Finally a column to do the distance calculation between the Change Location column and the jobs LatLong location.
I have done this, mainly as a proof of concept, and it works fairly well!! One additional thing I did is created custom actions for any View navigation. So even if they simply switched views, I was capturing their GPS location. It can take time to implement it all depending on the size of the app.
As @1minManager points out, unfortunately, any functionality built requires the user to actively use the app to trigger the updates including capturing GPS location. So try to build in some functionality that requires the user to utilize the app.
One last note…before the Google takeover there was a large push on AppSheet side to implement the automatic GPS location capture. With the Google takeover, it was put on hold. I have to think it is on their radar and I would think that since AppSheet is now in the hip pocket of Google, it would be even more possible to include.
Maybe the Community needs to provide a slight reminder we are still waiting for this??
EDITED: This feature request seems to have the most tracktion. Please place your vote here!
you state that its between the phones gps and here, but if I have a column in my data table called locations, which has the google maps coordinates of a location, and then use HERE() and DISTANCE() to calculate the difference between the two coordinates, and if that is less than 25, would this work?
currently the location is only one place, but it could build to more, so it would need to search through all the values in the list, find the nearest one, and use that as the location.
I’m sure you probably already know. It’s just a matter of using the LINKTO…() functions in an action, then including that inside of a Grouped action. A second action in the group captures the GPS location using the HERE() function.
Anywhere you have the capability to specify an action for navigation, you would replace it with a Grouped action like that described above. This obviously would NOT include the Main or Menu views. But for any other navigation actions such as Row Selection behavior, buttons to views, replace system Edit button with a custom action, etc, … for any of those you can “intercept” the action and replace it with a Grouped action that will capture the GPS and then continue on to the desired view.
It can end up being a LOT of actions to cover all possible navigation points.
I would agree but there are so many apps out there that do it already - namely the maps apps which Google has. So it’s already been done many times over.