# HOW TO: Display a button based on user location

**URL:** <https://community.glideapps.com/t/how-to-display-a-button-based-on-user-location/19157>\
**Category:** Ask for Help\
**Created:** [November 30, 2020, 6:14pm UTC](https://community.glideapps.com/t/how-to-display-a-button-based-on-user-location/19157 "2020-11-30T18:14:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamad\_Al\_Sadoon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mohamad_al_sadoon/32/14734_2.png) [@Mohamad\_Al\_Sadoon](https://community.glideapps.com/u/Mohamad_Al_Sadoon)\
**Post date:** [November 30, 2020, 6:14pm UTC](https://community.glideapps.com/t/how-to-display-a-button-based-on-user-location/19157/1 "2020-11-30T18:14:05Z")

</div>

Hey guys,

I’m building this app for a restaurant and I want to display the delivery button only when the user is within a certain radius from the restaurant.

Is there a way to make this happen?

---

<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:** [November 30, 2020, 6:23pm UTC](https://community.glideapps.com/t/how-to-display-a-button-based-on-user-location/19157/2 "2020-11-30T18:23:01Z")

</div>

Create a distance column and add a visibility condition if the distance is less than whatever value you choose.

---

<div class="post-metadata">

**Author:** ![Mohamad\_Al\_Sadoon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mohamad_al_sadoon/32/14734_2.png) [@Mohamad\_Al\_Sadoon](https://community.glideapps.com/u/Mohamad_Al_Sadoon)\
**Post date:** [November 30, 2020, 6:37pm UTC](https://community.glideapps.com/t/how-to-display-a-button-based-on-user-location/19157/3 "2020-11-30T18:37:59Z")

</div>

Is there a specific tab sheet that needs to host this column?

---

<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:** [November 30, 2020, 6:41pm UTC](https://community.glideapps.com/t/how-to-display-a-button-based-on-user-location/19157/4 "2020-11-30T18:41:27Z")

</div>

No, it’s a column type. Just create it in your restaurant sheet and point it to the address of the restaurant and the user’s current location.

[https://docs.glideapps.com/all/reference/data-editor/computed-columns/distance-to-location](https://docs.glideapps.com/all/reference/data-editor/computed-columns/distance-to-location)

---

<div class="post-metadata">

**Author:** ![Mohamad\_Al\_Sadoon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mohamad_al_sadoon/32/14734_2.png) [@Mohamad\_Al\_Sadoon](https://community.glideapps.com/u/Mohamad_Al_Sadoon)\
**Post date:** [November 30, 2020, 7:38pm UTC](https://community.glideapps.com/t/how-to-display-a-button-based-on-user-location/19157/5 "2020-11-30T19:38:03Z")

</div>

Yeah I did that. but how do I set the condition on the button

---

<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:** [November 30, 2020, 7:41pm UTC](https://community.glideapps.com/t/how-to-display-a-button-based-on-user-location/19157/6 "2020-11-30T19:41:46Z")

</div>

[https://docs.glideapps.com/all/reference/conditions/component-visibility](https://docs.glideapps.com/all/reference/conditions/component-visibility)

You could set the visibility to only show the button if the distance column value is less than 10 for example.
