# \[Plugin Update - Oct 9, 2019\] 'Env' Environment Variables

**URL:** <https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868>\
**Category:** Showcase\
**Created:** [October 9, 2019, 10:00am UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868 "2019-10-09T10:00:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaurav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gaurav/32/6666_2.png) [@gaurav](https://forum.bubble.io/u/gaurav)\
**Post date:** [October 9, 2019, 10:00am UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/1 "2019-10-09T10:00:34Z")

</div>

Hello bubblers,

Pushed a couple of updates to the ‘Env’ Environment variable plugin:

1. Define upto 6 Env variables with a single element 🕶
2. Trigger workflows when a variable data changes 🔥
3. Improved architecture enhancing performance

The [demo](https://bdkdemos.bubbleapps.io/env_variable) & [documentation](https://www.notion.so/Bubble-Developer-Kit-Plugins-3eb057d9d81d4176b1be678856c80faf#be6bbde5ee444a13ade861561338a594) have also been updated.

Its’ backward compatible. So if you’ve previously purchased the plugin, simply update the version in your plugins tab.

Cheers,  
Gaurav

---

<div class="post-metadata">

**Author:** ![gaurav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gaurav/32/6666_2.png) [@gaurav](https://forum.bubble.io/u/gaurav)\
**Post date:** [October 9, 2019, 10:11am UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/2 "2019-10-09T10:11:36Z")

</div>

- Create any number of Env variables from any spot in the app
- Read any variable from several places in the app simultaneously
- Write to any variable from any place in the app (workflow, action, auto-binding)
- Auto-bind any variable from one / several places in the app
- Trigger workflows when the Env’s value changes from any source
- Read / write any variable through JavaScript code

1. _Fast_ : They don’t touch the database or any external service.
2. _Temporary_ : Exist only until page exists. Destroy on reload / page change. Can be saved to database fields via workflows when required
3. _Flexible_ : Can be used with code as well as bubble. Dramatically reduces workflows. Truly connects reusable elements with each other & app pages

**Hassle-free setup without any need for database, workflows or custom states**  
[![](https://gauravbschooltest.s3.ap-south-1.amazonaws.com/env+demo+1.gif) ](https://gauravbschooltest.s3.ap-south-1.amazonaws.com/env+demo+1.gif)

**Run a JavaScript code, and map a variable in your code to an Env variable**  
[![](https://gauravbschooltest.s3.ap-south-1.amazonaws.com/env+%2B+code.gif) ](https://gauravbschooltest.s3.ap-south-1.amazonaws.com/env+%2B+code.gif)

Screen recordings showing how the demos were built:

_Setup video 1 - Sharing & syncing data across reusables and triggering workflows_:  
  
_Setup video 2 - Run a JavaScript code, and mapping the output to an Env variable_:

---

<div class="post-metadata">

**Author:** ![petter](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/petter/32/98626_2.png) [@petter](https://forum.bubble.io/u/petter)\
**Post date:** [October 9, 2019, 1:26pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/3 "2019-10-09T13:26:31Z")

</div>

Awesome @gaurav!

One of my most-used plugins.

---

<div class="post-metadata">

**Author:** ![petter](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/petter/32/98626_2.png) [@petter](https://forum.bubble.io/u/petter)\
**Post date:** [October 9, 2019, 2:01pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/4 "2019-10-09T14:01:38Z")

</div>

By the way, one challenge with the plugin (which is not a bug, but a general Bubble issue as far as I know), is that if the Env. Variable element is hidden when the variable is set, it will not receive the data until you “rewrite” the variable content again. This is especially a challenge with reusables, that are often invisible by default until they’re needed. It can easily be solved with workflows of course, but I’m curious if there are other ways this could be solved.

Something like a checkbox “Automatically fetch value when element becomes visible” or something. Is that something that could be implemented? Or do you know of an easy fix that I’m overlooking?

---

<div class="post-metadata">

**Author:** ![gaurav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gaurav/32/6666_2.png) [@gaurav](https://forum.bubble.io/u/gaurav)\
**Post date:** [October 9, 2019, 2:16pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/5 "2019-10-09T14:16:35Z")

</div>

This version fixes that 🙂

The only thing is that an Env needs to visible once for the code to load (that’s a bubble restriction).

Also you don’t actually need an Env element to set the variable. There’s a workflow step ‘Set Env’ which allows you to do this without any element.

---

<div class="post-metadata">

**Author:** ![petter](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/petter/32/98626_2.png) [@petter](https://forum.bubble.io/u/petter)\
**Post date:** [October 9, 2019, 2:28pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/6 "2019-10-09T14:28:31Z")

</div>

Perfect 🙂

> Also you don’t actually need an Env element to set the variable. There’s a workflow step ‘Set Env’ which allows you to do this without any element.

Ah, I thought the workflow needed the Element to work. Thanks for the tip 🙂

---

<div class="post-metadata">

**Author:** ![gaurav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gaurav/32/6666_2.png) [@gaurav](https://forum.bubble.io/u/gaurav)\
**Post date:** [October 9, 2019, 2:30pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/7 "2019-10-09T14:30:16Z")

</div>

Element actions need element to be visible. Workflows don’t. The Env variables supports both formats

---

<div class="post-metadata">

**Author:** ![Taiheta](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/taiheta/32/65061_2.png) [@Taiheta](https://forum.bubble.io/u/Taiheta)\
**Post date:** [October 9, 2019, 3:08pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/8 "2019-10-09T15:08:51Z")

</div>

> [@petter](#):
>
> By the way, one challenge with the plugin (which is not a bug, but a general Bubble issue as far as I know), is that if the Env. Variable element is hidden when the variable is set, it will not receive the data until you “rewrite” the variable content again.

> [@gaurav](#):
>
> This version fixes that 🙂

Tested working, thanks!

@gaurav would be possible for you to add the ability to conditionally check ‘update value’

![image](https://us1.discourse-cdn.com/bubble/original/3X/4/e/4e237fe85a0df3c984cc1d257de4953b41940b12.png)

---

<div class="post-metadata">

**Author:** ![gaurav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gaurav/32/6666_2.png) [@gaurav](https://forum.bubble.io/u/gaurav)\
**Post date:** [October 9, 2019, 4:06pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/9 "2019-10-09T16:06:24Z")

</div>

> [@Taiheta](#):
>
> @gaurav would be possible for you to add the ability to conditionally check ‘update value’

Done. Just pushed an update changing the checkbox to dynamic yes / no

---

<div class="post-metadata">

**Author:** ![troy.roberge](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/troy.roberge/32/51507_2.png) [@troy.roberge](https://forum.bubble.io/u/troy.roberge)\
**Post date:** [October 9, 2019, 4:12pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/10 "2019-10-09T16:12:55Z")

</div>

I’ll be buying this tonight, been meaning to for a while

---

<div class="post-metadata">

**Author:** ![Taiheta](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/taiheta/32/65061_2.png) [@Taiheta](https://forum.bubble.io/u/Taiheta)\
**Post date:** [October 9, 2019, 4:41pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/11 "2019-10-09T16:41:03Z")

</div>

Thanks!!!

---

<div class="post-metadata">

**Author:** ![eli](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eli/32/42610_2.png) [@eli](https://forum.bubble.io/u/eli)\
**Post date:** [October 9, 2019, 4:42pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/12 "2019-10-09T16:42:53Z")

</div>

> [@gaurav](#):
>
> - Define upto 6 Env variables with a single element 🕶
> - Trigger workflows when a variable data changes 🔥

You, my friend, are a BUBBLE HERO! This is awesome! Pair this with an If-Then-WF and you can do just about anything 😲

I’ll be updating my plugin today!

> [@gaurav](#):
>
> Also you don’t actually need an Env element to set the variable. There’s a workflow step ‘Set Env’ which allows you to do this without any element.

I did not know this. For clarification, if I use an Env called activejob in one reusable, I can set the value of that Env from a second reusable without adding an Env on the second reusable?

---

<div class="post-metadata">

**Author:** ![gaurav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gaurav/32/6666_2.png) [@gaurav](https://forum.bubble.io/u/gaurav)\
**Post date:** [October 9, 2019, 4:57pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/13 "2019-10-09T16:57:14Z")

</div>

Haha thanks @eli 😃

> [@eli](#):
>
> For clarification, if I use an Env called activejob in one reusable, I can set the value of that Env from a second reusable without adding an Env on the second reusable?

Oh yes absolutely… reusable, repeating group, main page etc. anywhere you can run a workflow from, you can set the value of an env. The element is required only to create & read the value of an env 🙂

---

<div class="post-metadata">

**Author:** ![eli](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eli/32/42610_2.png) [@eli](https://forum.bubble.io/u/eli)\
**Post date:** [October 9, 2019, 5:02pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/14 "2019-10-09T17:02:31Z")

</div>

> [@gaurav](#):
>
> The element is required only to create & read the value of an env 🙂

Rockstar!

---

<div class="post-metadata">

**Author:** ![eli](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eli/32/42610_2.png) [@eli](https://forum.bubble.io/u/eli)\
**Post date:** [October 9, 2019, 5:39pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/15 "2019-10-09T17:39:16Z")

</div>

Page by page my app is changing from this:

![image](https://us1.discourse-cdn.com/bubble/original/3X/0/6/0645a0ec0596259525b5fe70eecfac2b951d43f1.png)

To this:

![image](https://us1.discourse-cdn.com/bubble/original/3X/8/a/8a0da165fa807dff56e647870b64aa92730040a9.png)

The ability to store 6 variables in one Env is so much cleaner and more manageable.

---

<div class="post-metadata">

**Author:** ![gaurav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gaurav/32/6666_2.png) [@gaurav](https://forum.bubble.io/u/gaurav)\
**Post date:** [October 9, 2019, 5:57pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/16 "2019-10-09T17:57:04Z")

</div>

There’s a nifty little preview feature as well there 🙂 If you want to quickly see the variable names you’ve defined in the element just increase the size and it’ll list those as preview

---

<div class="post-metadata">

**Author:** ![petter](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/petter/32/98626_2.png) [@petter](https://forum.bubble.io/u/petter)\
**Post date:** [October 9, 2019, 5:57pm UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/17 "2019-10-09T17:57:53Z")

</div>

You my good man are just on a charm offensive today 😂

---

<div class="post-metadata">

**Author:** ![yonimn](https://avatars.discourse-cdn.com/v4/letter/y/838e76/32.png) [@yonimn](https://forum.bubble.io/u/yonimn)\
**Post date:** [October 22, 2019, 11:03am UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/18 "2019-10-22T11:03:00Z")

</div>

Hi @gaurav, is it possible to read a variable from a different page in the app?

---

<div class="post-metadata">

**Author:** ![boston85719](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/boston85719/32/77286_2.png) [@boston85719](https://forum.bubble.io/u/boston85719)\
**Post date:** [November 28, 2019, 10:31am UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/19 "2019-11-28T10:31:09Z")

</div>

I just want to add some instructions here as I spent about a half hour testing to figure this out…specifically one detail that is essential to functionality

1. The variable name MUST be exactly the same ( including capitalization…that threw me off and caused me to test and retest )

![28%20PM](https://us1.discourse-cdn.com/bubble/original/3X/3/4/34ab4e122941a88798ebaa4744b9b7b458602602.png)

1. You do not need to try and connect the Env Var elements…it is done magically ( I guess that’s the genius of the plugin )…so just place the Env Var element on the page or in the RE or RG you need to communicate with other elements, set up the variable name and type to match and then when one gets changed, they all get changed.

---

<div class="post-metadata">

**Author:** ![Taiheta](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/taiheta/32/65061_2.png) [@Taiheta](https://forum.bubble.io/u/Taiheta)\
**Post date:** [November 28, 2019, 10:53am UTC](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868/20 "2019-11-28T10:53:26Z")

</div>

why do you use underscores all the time just write camelCase

[Next page](https://forum.bubble.io/t/plugin-update-oct-9-2019-env-environment-variables/68868.md?page=2)
