How to create and use Environment Variables

How to create Environment Variables in Frends.

Environment Variables are optional static configuration information that is attached to a specific Environment in Frends. These variables are most commonly used to store information related to a Process or target system, such as passwords and usernames of systems that are being connected to.

Step by Step Tutorial Available

If you prefer more visual or interactive guidance on how to create Environment Variables in Frends, you can find a step-by-step walkthrough from your own environment's home page, under Onboarding by selecting "Tutorial 4, Step 2: Using Environment Variables in Process" tutorial.

Creating an Environment Variable

There are six kinds of environment variables:

  • Group: A Group Variable is used when grouping multiple keys under one root variable

  • List: A list of text Variables

  • Text: A string value

  • Number: An integer value

  • Boolean: Yes or no, true or false

  • Secret: A string variable that will hide its value from the UI

To create a new Environment Variable group, click on the "Create new" button on the left side of the View and add a descriptive name for the group. The group will be accessible as #env.MyVariableGroup in Process Editor, and any values under it as #env.MyVariableGroup.MyValue.

Groups will be listed on the left side of the Environment Variables view.

To add new values for a group, select the wanted group from the list and click "Create new" button under the Development Environment, or whichever is the default Environment for your Tenant. All Environment Variables will be available for all Environments, but they can have different values assigned to each variable for each Environment.

Environment Variable group's values are divided per Environment, but all Environments will contain the same variables.

When creating a new value for Environment Variable group, you need to assign it a name and a type. As an example, the following types of variables would be used to save (S)FTP connection information to Environment Variables.

  • SFTP Address: Text

  • Username: Text

  • Password: Secret

  • Port: Number

Assign the variable a name and select a suitable type for the value.

Once variables have been created, set values for them in both development and testing Environments. After adding or changing values to Environment Variables, remember to click "Save changes" from the bottom of the page. Creating and deleting Environment Variables will take effect immediately, but changing their value takes effect only after saving.

Changing the values requires saving. Creating or deleting variables will take effect instantly.

These Environment Variables are now ready to be used in a Process.

Using Environment Variables

Environment Variables can be used in Process Editor for parameter inputs. In this example, we will use created SFTP variables in an SFTP ListDirectory Task.

To be able to use an Environment Variable directly in a parameter input, the mode of the input needs to be "Expression". After that, you can reference them by typing "#env.FTP", and then autocomplete will suggest the appropriate key to choose. It is also possible to reference an Environment Variable in a non-expression parameter input as {{#env.FTP.Username}}.

Example showing the Environment Variables being used in expression-type input fields.

The Task will now use the values set in the Environment Variables when run in an Environment.

Editing Environment Variables

When an Environment Variable is edited, the next execution of any Process using that variable will use the new value instead of the old one. Editing or changing the Process is not necessary for the change to take effect.

Before editing an Environment Variable, it can be a good idea to verify where the Variable is in use to not make any unwanted changes. To view where the variable is being used:

  1. Search the Variable you want to edit

  2. Click on the small arrow next to the variable name

  3. Click on the "Show processes using variable" link that appears

Clicking on the small arrow next to Environment Variable value shows where it is used, alongside changelog.

From the same menu, it is also possible to see the changelog for that variable, showing who has added or changed the value, and when.

Deleting Environment Variable is only possible, if the variable is not being used in any Process in any Environment. For example when deleting an Environment Variable that is being used in a Process in Production Environment, you would need to remove the value from the Process in Development Environment, and then deploy the changed Process all the way to production as well, before the variable can be removed.

Last updated

Was this helpful?