Environment variables are variables present in all scripts that store data about the current working environment, including information about the runtime and the script. These data are often called properties or metadata.
By default, all scripts have environment variables. They are read-only variables, which means that you can only read their data during runtime to create logical flows that depend on environment metadata or log the data by using the Log Message (
Environment variables types
Environment variables have variable types and are organized as follows:
The error that occurred on the script. See more details about the Error environment variable.
The line number where the error occurred.
The line number of the current command.
The version of the current script.
Specific message about the error that occurred.
The name of the subroutine where the error occurred.
The name of the subroutine that calls the current subroutine.
The name of the current subroutine.
Added in 21.0.5:
The runtime environment the script is running in. If the script is running on IBM RPA Studio, it returns
Development. If it is running on Bot Runtime, it returns
Added in 21.0.5:
The name of the current script. If you are using or running the script on IBM RPA Studio, it returns the
.WALfile name. If you are running the script on Bot Runtime, it returns the script's name as published.
The maximum time a schedule of the script can run before it is canceled.
- Added in 21.0.5:
The script's metadata. Returns a summary of data such as
Environment variable properties
As normal variables, environment variables also have properties, an
rpa:error environment variable can have properties like
StackTrace, and these properties can have properties like
Count. If you are not familiar with variable properties, check the Using variable properties tutorial.
Environment variables in IBM RPA Studio
The Variables pane displays all the variables of your script including the environment variables, to visualize them click the Toggle environment variable visibility button. You can also view them when selecting variables in
any command by clicking the Toggle environment variable visibility or using the
CTRL + E shortcut.
The following image highlights the Toggle environment variable visibility button.