# New plugin - Global Variables

**URL:** <https://forum.bubble.io/t/new-plugin-global-variables/64180>\
**Category:** Showcase\
**Created:** [August 12, 2019, 6:58pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180 "2019-08-12T18:58:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [August 12, 2019, 6:58pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/1 "2019-08-12T18:58:38Z")

</div>

Hi !  
I’ve built this simple plugin where you can **set Global Variables on the user’s browser so you can access them without making a (slow) request to the database.**

It uses the cookies to store those values, each time the user’s browser is closed they will be erased so don’t forget to add some logic to check if the Variable is there.

For now you can only store text values but tell me if that’s a problem, I’ll add other options.

The plugin is similar to another one but with a more reasonable price point.

> **[Global Variables Plugin for Bubble](https://bubble.io/plugin/global-variables-1565434258241x896716752824565800)**
>
> Global Variables Plugin page on Bubble. Add Global Variables in one click to your app. Bubble lets you build web apps without any code.

  
**Keep on bubbling !**

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [August 12, 2019, 9:12pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/2 "2019-08-12T21:12:13Z")

</div>

**[Here](https://jpdom.bubbleapps.io/?plugin=GVP)** you can do a simple test of the plugin.

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [August 13, 2019, 11:05am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/3 "2019-08-13T11:05:36Z")

</div>

**Go to [https://jpdom.bubbleapps.io/](https://jpdom.bubbleapps.io/) and ask for a free trial in the “Contact” section 🙂**

---

<div class="post-metadata">

**Author:** ![dylan.b.anderson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dylan.b.anderson/32/91651_2.png) [@dylan.b.anderson](https://forum.bubble.io/u/dylan.b.anderson)\
**Post date:** [August 13, 2019, 12:53pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/4 "2019-08-13T12:53:49Z")

</div>

You offering freebies ;)?

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [August 13, 2019, 1:08pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/5 "2019-08-13T13:08:21Z")

</div>

You can try it to see if it works for 2 days, then you’ll have to buy me a beer 😁  
Just ask for it in the link I provided, include your app name please.

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [August 17, 2019, 3:54pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/6 "2019-08-17T15:54:12Z")

</div>

**Just a simple explanation:**

If you set the variable in one page with the name (for example) “TEST”, when you want to access it on another page you place a “Global Variable” element and in the property named “Variable Name” you write “TEST”:

![image.png](https://mail.google.com/mail/u/0?ui=2&ik=64adfb4dd7&attid=0.1&permmsgid=msg-a:r8736746580156925532&th=16c8be2d90fafe64&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ-mK988I3nUVZbLt1Ssn0cIxqNXo9bXQNuV8IVuNaQUHhh_WnQr0RQ5jK-w3JqSfCN63zxHnvOjXh2k5pvUHSsscHpjdlY84W8QT_81Hp40Y4SJLPhLQ44qCoA&disp=emb&realattid=ii_jza25z8n0)

To access the value you just reference the element’s value:

![image.png](https://mail.google.com/mail/u/0?ui=2&ik=64adfb4dd7&attid=0.2&permmsgid=msg-a:r8736746580156925532&th=16c8be2d90fafe64&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ8bboID_PmhW2QAdGb-goMm75c7cEqgK4Vmf_qEkCpPcAqkvFQ3jODzQPLLoS-P_pKleWUunThIR9bktPtSaDHp9C9bt21d3t8szrJ5VqMo8HOnX9sWuu8fLts&disp=emb&realattid=ii_jza2790o1)

For more questions, feel free to contact me through the website [https://jpdom.bubbleapps.io/](https://jpdom.bubbleapps.io/)

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [June 24, 2020, 10:02pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/7 "2020-06-24T22:02:34Z")

</div>

**UPDATE** - I’ve changed the price in order to let you pay monthly for a lower price.  
If you want a trial period I’m still offering that, just use the contact form in [jpdom.bubbleapps.io](http://jpdom.bubbleapps.io) and send me a request with your appID.

Happy bubbling !! 🙃

---

<div class="post-metadata">

**Author:** ![kovtun](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kovtun/32/77570_2.png) [@kovtun](https://forum.bubble.io/u/kovtun)\
**Post date:** [December 29, 2020, 4:16pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/8 "2020-12-29T16:16:07Z")

</div>

> [@joao1997domingues](#):
>
> you place a “Global Variable”

Please help. I found Set Global Variable action, but I can’t find Global Variable action to read a variable.

![2020-12-29_19-15-12](https://us1.discourse-cdn.com/bubble/original/3X/1/c/1cabe6373db27e9315af8dbd6f6ac0acc3a8d72c.jpeg)

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [December 29, 2020, 10:39pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/9 "2020-12-29T22:39:39Z")

</div>

HI @kovtun!  
Thanks for your purchase !  
You set the variable using a workflow action, to read the value you have to place the “Global Variable” element on your page and set it’s property "Variable name " to the same name you used to set the variable . Then, you can read the value of the variable using “Global Variable A.value” (reading the element’s value ).

Please tell me if you need further help !

---

<div class="post-metadata">

**Author:** ![rob.monkman](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rob.monkman/32/72889_2.png) [@rob.monkman](https://forum.bubble.io/u/rob.monkman)\
**Post date:** [January 27, 2021, 12:55am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/10 "2021-01-27T00:55:33Z")

</div>

HI,

I’ve installed this plugin but I’m not getting the results I expect. On first use, I got the expected result, but I can’t seem to be able to ‘clear’ the variable or update it. Am I missing something very obvious here…?

Use Case: I’m using an API to get artist data from Spotify which I display in a RG. I have an icon in the cell so that the user can ‘select’ one row from the RG - at which point I want to update the variable as I may (or may not) do something with that value. When the user interacts with that list again (i.e. selects another RG item), the variable should be updated. So I expected this to be pretty simple to put in place, but for some reason the variable isn’t updating and I just keep seeing the 1st selected value.

Any thoughts?

UPDATE: It appears to want a page refresh until you can get the most recent value, however even that is giving very inconstant results.

Thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [January 27, 2021, 8:35am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/11 "2021-01-27T08:35:31Z")

</div>

Hi @rob.monkman!  
Because of the way bubble treats the plugin you have to update the page in order to get the most updated result yes , this should work everytime . Please keep in mind that the results from an API request are also cached by bubble from what I understand ( requiring a page refresh).

If you need further help please contact me on private message.

Kind regards,

João Domingues

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [November 2, 2021, 10:35am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/13 "2021-11-02T10:35:34Z")

</div>

This issue is fixed, you no longer need to refresh the page to get the updated values, this is done dynamically.

---

<div class="post-metadata">

**Author:** ![pratimadudhewarpune](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pratimadudhewarpune](https://forum.bubble.io/u/pratimadudhewarpune)\
**Post date:** [March 22, 2022, 11:15am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/14 "2022-03-22T11:15:34Z")

</div>

Hi… Can we store list using this plugin? I mean key value pairs. or values with specific id’s.

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [March 22, 2022, 11:40am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/15 "2022-03-22T11:40:58Z")

</div>

Hi @pratimadudhewarpune !  
This plugin allows you to store text only.

I’m sorry if it doesn’t meet your needs, I’ll add this to the plugin future features list.

Happy Bubbling!

---

<div class="post-metadata">

**Author:** ![pratimadudhewarpune](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pratimadudhewarpune](https://forum.bubble.io/u/pratimadudhewarpune)\
**Post date:** [March 22, 2022, 1:23pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/16 "2022-03-22T13:23:20Z")

</div>

Do you need any other plugin to achieve the same? Want to store API result data

---

<div class="post-metadata">

**Author:** ![tomerlan5](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tomerlan5/32/87410_2.png) [@tomerlan5](https://forum.bubble.io/u/tomerlan5)\
**Post date:** [May 3, 2022, 1:33pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/17 "2022-05-03T13:33:21Z")

</div>

Hello Joao,

I am using your plugin - Global Variables, and it worked great up to right now.  
Suddenly it stopped updating the global variable I had in the background with nothing majorly changed. I have counted on your plugin a lot in the current app I am building and it is crucial I solve this problem fast for my superiors, please contact me as soon as possible and I can also help debug it if needed.

---

<div class="post-metadata">

**Author:** ![exception-rambler](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/exception-rambler/32/152704_2.png) [@exception-rambler](https://forum.bubble.io/u/exception-rambler)\
**Post date:** [May 3, 2022, 1:51pm UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/18 "2022-05-03T13:51:28Z")

</div>

I don’t use this plugin but am seeing a behaviour on my own plugins that might have the same root as this.

To check, are you publishing a value through this plugin through one step in a workflow, and then referencing that published value / global variable in another subsequent step?

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [May 4, 2022, 11:02am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/19 "2022-05-04T11:02:51Z")

</div>

Hi @tomerlan5 and @exception-rambler ,

@tomerlan5 Sorry to hear that!  
Are you using the latest version of the plugin? When did this problem start?  
No change has been made recently to the plugin and it still works on my side so probably @exception-rambler is right and it might be something on Bubble’s side, if that’s the case I would ask you to report this behavior to Bubble.

@exception-rambler Thank you for sharing your experience and helping figure this out!

---

<div class="post-metadata">

**Author:** ![joao1997domingues](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joao1997domingues/32/65430_2.png) [@joao1997domingues](https://forum.bubble.io/u/joao1997domingues)\
**Post date:** [May 4, 2022, 11:04am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/20 "2022-05-04T11:04:30Z")

</div>

P.S. - If needed we can schedule a quick meeting so I can have a look at your issue but first please reply to my questions so I can narrow the problem and guide you.

---

<div class="post-metadata">

**Author:** ![exception-rambler](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/exception-rambler/32/152704_2.png) [@exception-rambler](https://forum.bubble.io/u/exception-rambler)\
**Post date:** [May 4, 2022, 11:32am UTC](https://forum.bubble.io/t/new-plugin-global-variables/64180/21 "2022-05-04T11:32:41Z")

</div>

@joao1997domingues - what I’m seeing this side is that `publishState()` is surfacing results too late for actions within the same workflow to make use of them.

Without true return values from client-side plugins it’s always left to chance as to whether the value appears before it is needed - this has normally worked out fine but right now dependencies seem to arriving first. The thing is, it’s not really a bug 😭… it’s just an unreliable architecture

[Next page](https://forum.bubble.io/t/new-plugin-global-variables/64180.md?page=2)
