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 Interactions to determine the progression of the Interaction 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. In Interaction design, environment variables can be used in any component where system variables are supported.
Note: Multi Environment accounts are currently supported only in the web-based Interaction 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 Interaction 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 Interaction Variables page, click Add.
The New Interaction 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 Interaction 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 Interaction 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.
Working with Environment Variables: Best Practices
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 through Interaction logic. For example, you cannot use an environment variable on the left side of an Allocator.