Asset Globals
Pega Robot Studio provides a way to manage global variables across your project, called Globals. When working with Assets, you can use Asset globals to manage variables or components within an Asset. Globals and Asset globals otherwise function similarly, with the only difference being that of scope.
For example, a developer creates an Asset for an application that requires a user to be logged in. To track the log-in state, the developer adds a boolean variable called IsLoggedIn to the Asset globals. Then, in each Asset method, the developer uses the variable to check if the user is currently logged in before proceeding with the automation.
Just as with project Globals, you can also use Asset globals to store components that you want to reuse within your Asset. For example, you can add a ToastNotification component to the Asset globals for use as all-encompassing messaging within your asset.
To add a Global to an asset, on the Interface tab, click the button and then drag the global to the Globals list. The item is stored in the Globals folder of the asset, as shown in the following figure:
Check your knowledge with the following interaction:
This Topic is available in the following Module:
Want to help us improve this content?