# Location distance - frequently & user-specific workaround

**URL:** <https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129>\
**Category:** Ask for Help\
**Created:** [July 23, 2024, 10:44pm UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129 "2024-07-23T22:44:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaniv\_fogel](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yaniv_fogel/32/77555_2.png) [@yaniv\_fogel](https://community.glideapps.com/u/yaniv_fogel)\
**Post date:** [July 23, 2024, 10:44pm UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/1 "2024-07-23T22:44:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 24, 2024, 12:19am UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/2 "2024-07-24T00:19:51Z")

</div>

> [@yaniv\_fogel](#):
>
> How frequently is this ‘location distance’ be updated, assuming the user is walking continuously?

I’m not sure about this, maybe @Jeff_Hager knows better.

> [@yaniv\_fogel](#):
>
> 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?

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.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 24, 2024, 3:36am UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/3 "2024-07-24T03:36:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [July 24, 2024, 3:57am UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/4 "2024-07-24T03:57:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yaniv\_fogel](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yaniv_fogel/32/77555_2.png) [@yaniv\_fogel](https://community.glideapps.com/u/yaniv_fogel)\
**Post date:** [July 24, 2024, 10:19am UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/5 "2024-07-24T10:19:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [July 24, 2024, 11:14am UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/6 "2024-07-24T11:14:30Z")

</div>

> [@yaniv\_fogel](#):
>
> 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:

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.

---

<div class="post-metadata">

**Author:** ![yaniv\_fogel](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yaniv_fogel/32/77555_2.png) [@yaniv\_fogel](https://community.glideapps.com/u/yaniv_fogel)\
**Post date:** [July 24, 2024, 11:28am UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/7 "2024-07-24T11:28:36Z")

</div>

Oky! thanks so much Darren!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 24, 2024, 12:48pm UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/8 "2024-07-24T12:48:43Z")

</div>

After testing it this morning, it does appear to update the distance in near real time.

---

<div class="post-metadata">

**Author:** ![yaniv\_fogel](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yaniv_fogel/32/77555_2.png) [@yaniv\_fogel](https://community.glideapps.com/u/yaniv_fogel)\
**Post date:** [July 24, 2024, 12:51pm UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/9 "2024-07-24T12:51:59Z")

</div>

Thanks Jeff, I’m really appreciate your effort !

---

<div class="post-metadata">

**Author:** ![brunooneto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/brunooneto/32/60179_2.png) [@brunooneto](https://community.glideapps.com/u/brunooneto)\
**Post date:** [August 25, 2024, 5:40pm UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/10 "2024-08-25T17:40:14Z")

</div>

Can I store the _current location_, or the _distance from_ only?

Thank you

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [August 26, 2024, 12:14am UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/11 "2024-08-26T00:14:22Z")

</div>

Do you mean can you store the current location of the user?

---

<div class="post-metadata">

**Author:** ![brunooneto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/brunooneto/32/60179_2.png) [@brunooneto](https://community.glideapps.com/u/brunooneto)\
**Post date:** [August 26, 2024, 4:23pm UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/12 "2024-08-26T16:23:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [August 27, 2024, 12:14am UTC](https://community.glideapps.com/t/location-distance-frequently-user-specific-workaround/75129/13 "2024-08-27T00:14:17Z")

</div>

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.
