An Environment Variable is a special type of System Variable available in Multi Environment accounts only. The value of this variable type changes according to the current environment (DEV, TEST or PROD).
The Current Environment variable is an Environment Variable that is provided out-of-the-box to Multi Environment accounts. Its value (Dev, Test or Prod) is automatically populated according to the current environment. Use this variable in your Flows to determine the progression of the Flow in different environments. In addition, you can create an unlimited number of other Environment Variables to accommodate development and testing needs. For instance, you might want to define different Integration Point endpoints for the development and production environments. When designing a Flow, Environment Variables can be used in any component where System Variables are supported.
Note: Multi Environment accounts are currently supported only in the Web Designer.
This article presents:
- Creating and Modifying Environment Variables
- Working with Environment Variables: Best Practices
Creating and Modifying Environment Variables
Environment variables, like all System Variables, are created and modified from the System Variables page of the Resources menu. In the following example, two Environment Variables have been created (in addition to the out-of-the-box Current Environment variable).
Creating Environment Variables
The process for creating Environment Variables is very similar to that of creating any other System Variable.
To create a new environment variable:
- At the upper right corner of the System Variables page, click Add.
The New System Variable page opens.
- In the Variable Name textbox, enter a relevant name for the variable. This parameter must be defined.
- From the Variable Type dropdown list, select the appropriate type. The default type is Text.
- Configure the default value for the variable. The input field provided varies according to the variable type selected:
- Text, Number, Currency: A textbox is presented.
- Boolean: A checkbox is presented.
- Date: A textbox with a date picker is presented. Use the date picker to navigate to and select a date. Alternatively, enter the date in the textbox.
Specify the date format by selecting the required format from the Format dropdown list at the bottom of the page. The Custom option allows you to define a customized date format.
- Image: No default value may be defined.
- In the Description field, enter notes or comments related to the variable.
- From the Environment Variable dropdown list, select Yes.
The Read Only dropdown list is disabled. (Environment variables may not be read only.)
- Click Save.
A confirmation message is displayed, and the new variable is displayed in the System Variables list.
Modifying Variable Details
The following details of an Environment Variable may be modified:
- Default value
In addition, you may change an Environment Variable into a non-Environment Variable, and vice versa.
To modify variable details:
- From the left side of the System Variables page, click the link of the variable you want to modify.
The Details page of the selected variable opens.
- At the upper right corner of the Details page, click Edit.
All parameters become editable.
- Update the parameters as required.
- At the right upper corner of the page, click Save.
A confirmation message is displayed, and changes are saved in the system.
Note: When you modify the name of an existing Environment variable, the variable name is not automatically updated in any interactions where it is used. In the event of a conflict, you need to manually update the old variable name to point to the new name wherever it occurs in the interaction. You can locate all occurrences of the variable under the 'Usage' tab.
Best Practices for Working with Environment Variables
This section provides some more details and recommended tips for working with Environment Variables successfully.
- When you create Environment Variables in one environment, they are not automatically added to the other two environments. However, when you deploy resources to another environment using the Deployment Wizard, all Environment Variables are automatically deployed together with the selected resources.
- Although all Environment Variables are automatically included in a deployment package, their default values are not automatically updated upon deployment to the target environment. After deploying resources, it is recommended to review all Environment Variables and update their values manually (when relevant).
- The value of an Environment Variable may not be changed using Flow logic. For example, you cannot use an Environment Variable on the left side of an Allocator.