Skip to main content
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Automation variables

Automation Variables

Pega Robot Studio™ provides many standard variables that can hold different values, including the most common ones of String, Integer, Boolean, Double, Char, and DateTime. Pega Robot Studio also provides variables that can store color, Rich Text Format, and font. All these variables are similar to .NET variables.

You can access variables from the Variables section of the Toolbox. You can drag and drop the required variable from the Toolbox into the automation.

automation variables 1

Similar to a programming language, you can define the scope of the variable as local or global. Local variables are accessible only in the individual automation. Global variables are accessible to all the automations throughout a project, but not the solution with multiple projects. Pega Robot Studio provides another mechanism to share variable values across projects.

When adding variables to an automation, they display in the Components tray at the bottom of the automation. By default, when you add a variable to an automation, Studio classifies the variable as local to the automation. You can change the local variable to global by right-clicking on the variable and selecting Make Global.

automation variables 2

Global Container

It is difficult to manage project-level or Global variables and remember which automation contains them. To avoid such difficulty, Pega Robot Studio provides a project item called Global Container. The Global Container provides a common area to store variables that of global scope. The Global Container can also store Pega Robot Studio components such as SQLQuery, RobotActivity, and so on. When added to a project, the Global Container appears in both the Object Explorer and Solution Explorer. There is no functional difference between the components added to the Global Container and those added to the Global tab of a component tray.

It is a best practice to have at least one Global Container for each project in the solution. The naming convention followed for a Global Container in a project is _GC_{project name without suffix "Prj"}.

global container 1

If you are using more than one global container within a project, append the usage of the project item at the end of the name. For example, use _GC_CRM_Variables to differentiate the contents of each global container.

Adding a component to a Global Container project item:

global container 2
  • In Solution Explorer, right-click the Global Container project item and select Open .
  • From the Toolbox, drag the reusable component(variable) onto the Global Container design pane.
  • Save the Global Container project item.

This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice