Hi guys, thanks for all the support.
I have a table with hundreds of locations (geo coordinates) that I’m displaying in a collection.
Since there’s no radar available, I want users to be able to sort the collection based on their current location, with the closest locations first. To achieve this, I added a ‘location distance’ column to my table that calculates the distance between the user’s location and my fixed geo coordinates.
My questions are:
a. How frequently is this ‘location distance’ be updated, assuming the user is walking continuously?
b. I want many users to use my app, but ‘location distance’ can’t be set as user-specific. Any thoughts on how to structure the data so it won’t be overwritten by different users?
thank you
Yan
I’m not sure about this, maybe @Jeff_Hager knows better.
If you set the “From” to “Current Location”, it should calculate based on that user’s position anyway. In that sense, it’s users-specific.
If I remember, I’ll double check when I drive to work in the morning. I would guess that it would be similar to the location component and update approximately every 5 to 10 seconds.
1 Like
Yes, that’s been my experience.
I have an App that only allows workers to “Clock In” when they are within a certain distance of a designated entry point to their workplace. The App shows them how far away they are from the nearest entry point, and the distance shown updates in near real time as they move around.
3 Likes
I think that you’re right about how the calculation is done based on the user’s location. However, my main concern is this:
If User A and User B are both using the app and constantly moving, they will keep overwriting this same column with their respective location data. it creates a problem:
You won’t be able to maintain a collection or history of locations for each user separately. Instead, the data will keep alternating between User A’s and User B’s locations, making it impossible to show a meaningful location-based collection or history for either user individually.
This “ping-pong” effect between the two users’ locations prevents you from building up a useful dataset for each user over time.
No, that’s not what happens at all.
The Distance to Location column is a computed column, which means that the calculation happens separately on each users device, and every user gets a different result, based on their location.
Nothing gets overwritten, because there is nothing to overwrite. It’s a computed value.
Keeping a history is a different matter. For that you would need an action that writes the current values into a table somewhere. You would include a user identifier in that, so that data can be aggregated per user.
2 Likes
Oky! thanks so much Darren!
After testing it this morning, it does appear to update the distance in near real time.
2 Likes
Thanks Jeff, I’m really appreciate your effort !
1 Like
Can I store the current location, or the distance from only?
Thank you
Do you mean can you store the current location of the user?
I meant get the “current device location” as a “special value”, like we can do “current date/time”. Without the need of the user switching on the “get device location” component.
Thank yoou
No, we don’t have the option to do that natively. For security reasons, you would always need users to allow the retrieval of their location before it’s written to a field.