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

@beau @Taiheta Because camelCase reminds me of Camel Toe and it is an unflattering look, so I avoid it…but I am also not a coder so I don’t actually use a strict method all the time, especially since bubble doesn’t require capitalization consistency for searches.

Why do you use camelCase? What have you found to be the benefits?

1 Like

Yep exactly… and its’ superfast.

@Taiheta
Lol your DP is awesome. :raised_hands:

2 Likes

@gaurav I am experiencing some issues with the plugin.

I am attempting to use the plugin to pass a datatype between two reusable elements and the page. One reusable element is a menu for use in a repeating group on page. The second reusable element is used to add information to the datatype being modified/deleted/created.

The issue is specifically around the workflow action “when env var value is changed”

I have the following set up for each of the env var ( the focus is on env var #5 )

55%20PM

What the goal is that when the env var #5 value is changed ( based on another workflow event ) that a custom state list will get updated.

On each reusable element and on the page I have the env variable values displayed to verify and check that values are changing as they should.

The parent group’s event ticket is coming from the reusable element menu: below is a gif of the issue in action.

env%20var%20issue

I have on the page the workflow event to use the env var value #5 to update the list of tickets

My workflow action for adding the ticket to the list does not rely on the env var plugin and uses the following workflow and is working as expected.

Any ideas as to why the workflow event is not getting triggered for “when env var value #5 is changed” so that the custom state list has the selected ticket removed from the list?

Or why the plugin might not be communicating the data type to the custom state list?

I have the custom state list set up correctly for the data type, which matches the data type being passed using the env var plugin

However, as you can see in the gif the list does not get updated

You haven’t checked the ‘Trigger workflow on change’ checkbox (refer to your first 3 screenshots in the post)

1 Like

Got it…thank you

When this is used for page navigation for single page apps, How can I prevent page from triggering “back” when browser’s back button is clicked?

Hi @shu.teopengco,
Not sure I understand the question actually… can you elaborate on how you’re using the Env variables setup for this purpose… The browser’s back button and env variable have no obvious connection to my knowledge.

Best,
Gaurav

Hi @gaurav,

I have one feature request for the EnvVariable. When using conditions, and going through the “Link env #2” and “to this value” it can be difficult to see if “to this value” is connected to the correct variable. Would it be possible to add a number to that setting, such as “(2) to this value” or something like that?

image

@petter this is done :slight_smile:
Just pushed an update changing the title to include variable number ahead of that text

1 Like

Awesome, that was fast! Thank you :slight_smile:

1 Like

I’m planning to use this mainly for navigation (to show and hide pages dynamically for single pge apps). Currently, I’m using url params to view and hide groups(page sections) by using the workflow “go to page”. I want to use this for navigation by having “current_pageSection” or “current_pageView”. However, when I use that method, when browser’s back button is clicked or go to previous page is initiated, it will go back to previous page outside the app, not the last pageSection.

@gaurav I got an error when I am using OptionSets for the type of variables. Is that a limitation?

Screenshot 2020-05-08 00.09.09

@soh.ju.hu Yep that’s correct. Details here

Hi @shu.teopengco,
That’s how bubble works no… In my experience, you will probably need to override the browser history using js or some plugin (or maybe bubble has added a feature). That way the browser will consider it as previous page. Note that it isn’t at all related to env variables plugin.

If you’re looking for one-page app navigation system with ability to revert to previous view I recommend taking a look at Easylist element in the Utilities (bdk) plugin.

Best,
Gaurav

Thanks @gaurav, I did a work-around for now, just filter by the “Display” of All Options.

1 Like

@gaurav Can you store a list of things within the env variable? I have a list of users that I wanted to store and access through a reuseable element, but everytime I set env variable it errors saying that I can only set a single item and not a list.

Hi @messly,

Not at the moment but a wip :slight_smile:

I am using the ENV Variable on the main page of my app and set the typeas Client

The user would then add another client using a backend workflow, where a new client is created.
When this happens I want the ENV variable to be updated, which triggers a workflow. This workflow then adds a the client in the ENV variable to the Easy List plugin, from where I can do searches of clients in the Db.

My issue is that I run the set Env action in the backend workflow where the new client is created. It is a client type and a trippled checked the Variable name, but when the backend workflow runs, it does not update that particular ENV Variable. So the workflow to update the list does not run. I put a simple check in place showing the name of the ENV Variable client, but it remains empty even though the backend workflow ran.


I know for a fact the new client was created as it updates the current user’s client and shows the name when I reference that, but not if I reference the ENV Variable.

Am I missing something?

Here is a 2 min video run through of the setupp and the issue

Here you can see the Backend Workflow running when I clicked the button in the video:


Which is the one where I set the env variable in the backend workflow.

I am just wondering how I get support for this plugin if not via the forum?

Hi @christo1

Env variables are front-end only… they can’t be set in backend workflows. Backend workflows are run on bubble’s servers and plugins aren’t allowed to set data there. From backend to frontend, the only way of sending data is to use bubble’s database (i.e. save thing).

You can ‘Link’ the env variable on the page to the database field you’re saving, so that in effect you’ll be updating the env variable in the frontend whenever the field changes. In addition you can even run a workflow on the front end when this happens using the Trigger workflow on change checked .

You can reach out via chat at https://thebdk.com

Hope this helps!
Cheers,
Gaurav