Overview
The Set Variable action allows you to set a variable to a specific value for a task or workflow, and to select a scope (level of usage) for that variable (see Variables and Variable Scope, below). Unless you set the scope of the variable to GLOBAL, which specifies that the variable can be accessed at any time by any task, workflow, or trigger, the value exists in memory only for the time that the task or workflow is running, or until another Set Variable action sets the variable to another value.
Note
Variables with a Variable Scope set to GLOBAL are added to the list of global variables on the Variables list (Automation Center > Other > Variables) after the task or workflow is run.
You can use the Set Variable action to create a new variable or modify an existing variable.
When creating a Set Variable action, you can trigger the Set Variable action based on one or more of the following:
- Status
- Exit codes
- Late start
- Late or early finish
Variables and Variable Scope
A variable defined for a task under the Variables tab for that task is used only by that task.
A variable defined for a workflow under the Variables tab for that workflow is available for any task in that workflow; a task will use the variable value defined for the workflow unless the variable is defined for that task.
A variable defined for a task or workflow in the Set Variable Action Details lets you specify, in the Variable Scope field, the scope of that variable. You can specify that a variable be available for:
- Only the task where it is set.
- All tasks within the task's parent (immediate) workflow.
- All tasks within the task's top-level parent workflow.
- All tasks and workflow instances.
For example, if you set a variable for a task to be available within the scope of its parent workflow, the value of that variable is propagated up to the parent workflow level. As each task in the workflow is run, that value is available for that task.
Creating a Set Variable Action
Step 1 | Display the Task Details of the task for which you are creating the Set Variable action. |
---|---|
Step 2 | Click the Actions tab. A list of any defined Actions for that task displays. |
Step 3 | Click the New button that displays on the Set Variables row. The Set Variable Details pop-up displays. |
Step 4 | Using the field descriptions below as a guide, complete the fields as needed. |
Step 5 | Click a Save button to save the record in the Controller database. |
Step 6 | If appropriate, repeat these steps for any additional Set Variable actions you want to create. |
Set Variable Details Field Descriptions
The table below describes the fields and buttons in the Set Variable Details.
Field Name | Description |
---|---|
Action Criteria | This section contains criteria for performing the action. |
Type Details | Displays - on the Set Variables actions list - the Variable Scope, Name, and Value for this action. |
Action Inheritance | Unable to render {include} The included page could not be found. |
Status | The status of the task, by itself or together with an exit code, that will trigger this Set Variable action. You can specify as many statuses as needed. |
Exit Codes | Unable to render {include} The included page could not be found. |
On Late Start | Unable to render {include} The included page could not be found. |
On Late Finish | Unable to render {include} The included page could not be found. |
On Early Finish | Unable to render {include} The included page could not be found. |
On Projected Late | Unable to render {include} The included page could not be found. |
Description | Description of this action. |
Action Details | This section contains additional details about the action. |
Variable Scope | Unable to render {include} The included page could not be found. |
System Notification | If Variable Scope = Global; Status of the Set Variable action that will trigger a system notification. Note The Controller must be configured for system notifications in order for system notifications to be triggered. |
Name | Name of the variable. Up to 128 alphanumerics. The name must begin with an alphabetic character and can consist of: alphas (a-z, A-Z), numerics 0-9, _ (underscore). White spaces are not permitted; names are not case-sensitive. Do not define variables with the prefix ops_. The ops_ prefix is reserved for built-in variables. If the specified variable name contains an embedded variable or function, the above restrictions will not be validated until runtime. |
Value | Value of the variable. Note While a global variable value can never exceed 25000 characters, a task instance variable value assigned dynamically at run time (for example, using a function to assign a variable value to Self, Parent, or Top Level Parent, using the Set Variable Action, can exceed the 25000 character limit. Keep in mind, however, that the Maximum Nested Variable Expansion Universal Controller system property prevents unlimited variable value expansion. |
Metadata | This section contains Metadata information about this record. |
UUID | Universally Unique Identifier of this record. |
Updated By | Name of the user that last updated this record. |
Updated | Date and time that this record was last updated. |
Created By | Name of the user that created this record. |
Created | Date and time that this record was created. |
Buttons | This section identifies the buttons displayed above and below the Action Details that let you perform various actions. |
Save | Saves a new Action record in the Controller database. |
Save & New | Saves a new record in the Controller database and redisplays empty Details so that you can create another new record. |
Save & View | Saves a new record in the Controller database and continues to display that record. |
New | Displays empty (except for default values) Details for creating a new record. |
Update | Unable to render {include} The included page could not be found. |
Delete | Unable to render {include} The included page could not be found. |
Refresh | Refreshes any dynamic data displayed in the Details. |
Close | Closes the Details pop-up of this action. |