# Update location when it changes

**URL:** <https://forum.bubble.io/t/update-location-when-it-changes/84611>\
**Category:** Need help\
**Created:** [April 2, 2020, 11:06pm UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611 "2020-04-02T23:06:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamprogr](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mamprogr/32/56715_2.png) [@mamprogr](https://forum.bubble.io/u/mamprogr)\
**Post date:** [April 2, 2020, 11:06pm UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/1 "2020-04-02T23:06:02Z")

</div>

Hi,  
I have a location field in user datatype. I want to update the user location to the current location automatically.

I have two questions:

1. How can I run the update action across pages (i.e., in the background) without rewriting it in all pages?
2. Is there any event like “when current location changes”?

Thanks.

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [April 2, 2020, 11:37pm UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/2 "2020-04-02T23:37:28Z")

</div>

Create a place in the database. So what I mean is create a new type called “Website Settings” and have a field called “Background Color,” type “text.” Insert dynamic data for “Do a search for Website Settings:first item’s Background Color”.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![mamprogr](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mamprogr/32/56715_2.png) [@mamprogr](https://forum.bubble.io/u/mamprogr)\
**Post date:** [April 2, 2020, 11:55pm UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/3 "2020-04-02T23:55:14Z")

</div>

Thanks for your reply but I didn’t get the relation between the location updating and what you mentioned about.  
Could you explain a little bit?

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [April 3, 2020, 12:17am UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/4 "2020-04-03T00:17:57Z")

</div>

What do you mean by location? Geographic Location?

---

<div class="post-metadata">

**Author:** ![codably](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/codably/32/193521_2.png) [@codably](https://forum.bubble.io/u/codably)\
**Post date:** [April 3, 2020, 1:14am UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/5 "2020-04-03T01:14:29Z")

</div>

Hi, have you considered adding a Workflow to a reusable element, such as the Header? You could update the location on page load. Then it will occur on every page load.

---

<div class="post-metadata">

**Author:** ![mamprogr](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mamprogr/32/56715_2.png) [@mamprogr](https://forum.bubble.io/u/mamprogr)\
**Post date:** [April 3, 2020, 8:02am UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/6 "2020-04-03T08:02:29Z")

</div>

@johnny Yes, I mean the geographic location.

@codably Nice idea, thanks.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [April 3, 2020, 8:09am UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/7 "2020-04-03T08:09:43Z")

</div>

> [@mamprogr](#):
>
> Is there any event like “when current location changes”?

No, but there is a “Do every x seconds”. Which is much the same thing.

---

<div class="post-metadata">

**Author:** ![di\_lucena](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/di_lucena/32/50410_2.png) [@di\_lucena](https://forum.bubble.io/u/di_lucena)\
**Post date:** [April 3, 2020, 10:47am UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/8 "2020-04-03T10:47:00Z")

</div>

Never needed this in my apps but I guess a “do every x seconds” with a “get geographic location” and “make changes to user” is the way to go.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [June 11, 2020, 11:06pm UTC](https://forum.bubble.io/t/update-location-when-it-changes/84611/9 "2020-06-11T23:06:05Z")

</div>

Closed on June 11, 2020, 11:06pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
