Processes/Objects – Environment Variables

An environment variable is a variable that can be used across all processes and business objects in your Blue Prism Enterprise environment.

When using standalone data item stages, if the same variable is used across multiple processes and objects and the value changes, you must update it in all the data items in which it is used. By using an environment variable, if the value changes it will automatically be updated in all the processes and objects in which it is used the next time they are executed.

You can create and manage environment variables under System > Processes or System > Objects. The list of environment variables is the same in both places; any variables created for processes are also available for objects (and vice versa).

Create an environment variable

You can create an environment variable under either Processes or Objects in System Manager.

The environment variable will be available to all processes and objects regardless of where you create it.

  1. In Blue Prism Enterprise, navigate to System > Processes - Environment Variables or System > Objects - Environment Variables.
  2. Click Add Variable.

    A row is added to the environment variables table.

  3. In the Name field, enter a name for the environment variable.
  4. From the Type drop-down list, select the data type for the environment variable.
  5. In the Description field, enter a description for the environment variable.

    It is important to provide useful information in the description, so that other users referencing the environment variable in processes or objects can be sure of its purpose.

  6. In the Value field, enter a value for the environment variable, based on the selected data type.
  7. Click Apply.

Use an environment variable in a data item

You can use an environment variable to set the value of a data item in a process or object. Whenever the value of the environment variable is changed, the value of any data items that reference the variable will be updated automatically the next time the processes or objects in which they are used are executed.

  1. In Studio, open the process or object that requires the environment variable.
  2. Add a new data item that you want to use the environment variable for, or open an existing data item.
  3. From the Exposure drop-down list, select Environment - Read the corresponding Environment Variable from System Manager.
  4. The Name field is now a drop-down list. From the list, select the environment variable that you want to use.

    Data Type and Initial Value are now read-only, as their values are set by the environment variable and cannot be edited in the data item.

    Data Properties dialog with Exposure set to Environment

  5. Click OK.

Find environment variable references

You can find out which processes or objects reference an environment variable. Before making any changes to the value of an environment variable, you should always perform the following steps to check which processes or objects would be affected by the change.

  1. In Blue Prism Enterprise, navigate to System > Processes - Environment Variables or System > Objects - Environment Variables.

    The environment variable will be available to all processes and objects regardless of where you create it.

  2. Select the row for the environment variable for which you want to find references.

  3. Click Find References.

    The Find References dialog displays with a row showing the Name and Description of each process or object in which the variable is used.

  4. Click View in a row for a process or object to open that process or object in Studio. You can then investigate further to see how the variable is used.
  5. When you have finished, you can close the Find References dialog.

Edit the value of an environment variable

  1. In Blue Prism Enterprise, navigate to System > Processes > Environment Variables or System > Objects > Environment Variables.

    The list of variables is the same regardless of which option you select.

  2. Select the row for the environment variable that you want to edit.

  3. In the Value field, enter the new value for the environment variable.
  4. Click Apply.

    The value will be updated in any processes or objects that reference the environment variable.

You can also edit the Name or Type of an environment variable, however this will cause issues in any processes or objects where the variable is used.

  • Editing the name of the variable will break the connection to any processes or objects in which it is used.
  • Editing the type of the variable may break the logic within any processes or objects in which it is used.

Before changing the name or type of an environment variable, it is recommended to first find any references to the variable in processes or objects to analyze the impact of any changes.

Delete an environment variable

  1. In Blue Prism Enterprise, navigate to System > Processes - Environment Variables or System > Objects - Environment Variables.

    The list of variables is the same regardless of which option you select.

  2. Select the row for the environment variable that you want to delete.

  3. Click Remove Variable.

    The Checking For References dialog displays. This dialog shows whether the environment variable is used in any processes or objects.

  4. If the variable is not used in any processes or objects, you will see a green check mark and the Delete check box is selected by default. Click Delete Selected Items to delete the environment variable.

    If the variable is used by a process or object, you will see a warning icon and the Delete check box is not selected. Before you delete the environment variable, you should edit the affected processes or objects first so that they longer use it.

    You can delete the environment variable without first editing any processes or objects that reference it by selecting the Delete check box, then clicking Delete Selected Items. However, you should make a note of the processes and objects that use the deleted environment variable so that you can update them later to fix any errors that this causes.

  5. Click Apply.