Using the Environment Variables#

Warning

Not available in Factory Lite license. Available in Factory Personal license with restriction (no Vault variable case).

The Environment variables are variables defined at a higher level, which are inherited by the whole set of Primary Resources belonging to the current environment. They allow a higher level of control and configuration, which is automatically shared with the resources within the environment and can override local setting, according to the environment properties.

Environment variables are in their usage, definition and modification variables as the general case. Therefore, even for the Environment variables all the properties listed in the general overview still stand.

As said in the Environment presentation, it is possible to build environments within environments. Therefore, it is necessary to impose a hierarchy when different environments have the same variable defined. The hierarchy structure applied to the Environment variables is that any internal environment variable overrides the more general one. This permits the user to create a more and more precise structure when specific cases are treated as internal environments.

To open the Environment Variable Manager you need to right-click on the desired Environment and to select Environment Variables entry.


Environment Variable Manager#

The Environment Variable Manager allows the modification of all the environment variables defined in the current Environment.

The manager panel is divided into two tabs, which correspond to the two different variable types, Code or Vault. In each tab you can:

  • Add new variables by clicking on the plus button.

  • Delete existing variables, by selecting them and then by pressing the minus button.

  • Modify the name or the value of an existing variable by interacting with the table itself.

Warning

The variable name can contain ASCII alphanumerical characters (capital or not) and the underscore (_) symbol only.

In the Vault Variable panel each variable needs to be linked to a Vault Resource, which needs to exist and for which the user needs to have the view permission allowed.

Editing, creation and deletion operations on Environment variables have an immediate impact on the variables’ Source options related to any primary resource contained in the environment itself, or in any environment within the environment(for a definition of the Source property please refer to this page).

  • The creation of an Environment variable adds the new variable to any resource within it if it doesn’t exist. Alternatively, this operation changes the existing variable with the same name, so that the Source value becomes Environment.

  • The deletion of an Environment variable changes all the variables with the same name, so that Source value becomes Local in any internal primary resources.

  • The editing of an Environment variable modifies all the variables with the same name, which have Source value Environment, leaving the others untouched.

  • The renaming of an Environment variables should be interpreted as a deletion/creation operation for what concerns the effects on internal resources.

Procedure

  1. Open the Explorer.

  2. Browse to the chosen environment and right click on it. Alternatively, you can click on the three-dotted button.

  3. Select Environment Variables.

  4. Select whether you want to add Code variables or Vault variables by clicking on the corresponding tab.

  5. Set the variables by either:

    • Clicking on the variable you want to modify;

    • Clicking on the plus button to add new variables and to set them by choosing the number and whether if they are sensitive or not;

    • Clicking on the minus icon to delete a variable.

  6. Click Save to save the changes or Discard to close the panel without applying changes.

Example

Imagine a scenario in which the Environment DEV contains a primary resource of type flow with the following variables:

  • today - currDate()

  • rules - ' OR '

The variables above have a Local source, as they have been set within the flow.

We need to add a new variable, which must be common in all the primary resources, so we’re going to add it to the Environment Variable Manager.

Open the Explorer and browse to the environment the flow belongs to. Right click on it and select Environment Variables.

Add a new variable by clicking on the plus button. Define it as follows:

  • Name - department

  • Value - ‘Marketing’

Then, click Save.

Go back to the flow and open the Variables tab: as you can see, the variable defined at environment level has a light green background. Moreover, if you open the Variables Panel, the variable department has the value Environment as Source.