User-Defined Variables

User-Defined Variables

Overview

User-defined Universal Controller variables are available for use in triggers, tasks, and Workflows.

You can define variables to be either:

You define Local variables (variables specific to a single trigger, task, or workflow) on the Variables tab in the Details of that trigger, task, or workflow. These variables are stored in the ops_local_variable table.

You define Global variables either by:

Global variables are stored in the ops_variable table.

Variable Naming Conventions

  • Variable names must begin with a letter.

  • Allowable characters are alphanumerics (upper or lower case), and underscore (_).

  • White spaces are not permitted

  • Variable names are not case-sensitive.

Warning

Do not define Controller variables with the prefix ops_. That prefix is reserved for built-in variables.

Resolving User-Defined Variables

When the Controller creates a task instance from a task, it also resolves all variables specified in its free text fields. Because you can define variables at four different levels (trigger, task, workflow, and global), the Controller follows a prescribed formula to determine which variable takes precedence if duplicate variables have been defined. The general order of precedence, each of which may or may not exist in any given situation, is as follows:

  1. Task trigger (highest precedence)

  2. Task

  3. Workflow trigger

  4. Workflow

  5. Global (lowest precedence)

Note

You also can use the Set Variable Action of any task or workflow to define a variable. The Set Variable action explicitly states what scope you are setting the variable at, and under what circumstances.

The following scenarios provide more detailed information about how Controller variables are resolved.

For Tasks Launched by a Trigger

  1. If the trigger defines the variable in the variables tab, that value is used to resolve the variable.

  2. If the trigger does not define the variable, the value from the variable tab in the task Details is used.

  3. If neither the trigger nor the task define the variable, the variable definition in the global variables table is used.

  4. If the global variables table does not define the variable, the variable remains unresolved.

For Tasks Launched by a Workflow

  1. If the task defines the variable in the variables tab, that value is used to resolve the variable.

  2. If the task does not define the variable, and the workflow was launched by a trigger, the value defined in the trigger is used.

  3. If the workflow's trigger does not define the variable or the workflow was not launched by a trigger, the value defined in the workflow is used.

  4. If the workflow does not define the variable, and there is a parent workflow, the value defined in the parent workflow's trigger is used.

  5. If the parent workflow's trigger does not define the variable or if there is no trigger, the value defined in the parent workflow is used.

  6. If the parent workflow does not define the variable, the Controller checks up a level for the trigger on the next parent workflow.

  7. If that trigger does not define the variable, it checks for variables associated with the workflow. (This continues until the top level workflow is reached.)

  8. If the top-level workflow does not define the variable, the variable definition in the global variables table is used.

  9. If the global variables table does not define the variable, the variable remains unresolved.

For Tasks Launched Manually

  1. If the task defines the variable in the variables tab, that value is used to resolve the variable.

  2. If the task does not define the variable, the variable definition in the global variables table is used.

  3. If the global variables table does not define the variable, the variable remains unresolved.

Format for Using Variables

When you enter a variable into a text field, precede the variable with the dollar sign ( $ ) and enclose the variable in curly braces ( { } ). You can enter a series of variables or nested variables.

Examples:

${variable_name} ${v1}${v2} ${${inner_variable}}

Creating a Variable

You can create variables that are:

  1. Available on a Global level; that is, available for all triggers, tasks, and Workflows.

  2. Available only for a specific trigger, task, or Workflow.
     

Creating a Global Variable

To create a Global variable that is available for all triggers, tasks, and Workflows:

Step 1

From the Automation Center navigation pane, select Other > Variables. The Variables list displays a list of all Global variables. (You also can define a Global variable by using the Set Variable action for a task or workflow.)
 
To the right of the list, Variable Details for a new Global variable displays.
 

Step 2

Enter / select Details for a new Variable, using the field descriptions below as a guide.

  • Required fields display an asterisk ( * ) after the field name.

  • Default values for fields, if available, display automatically.

To display more of the Details fields on the screen, you can either:

  • Use the scroll bar.

  • Temporarily hide the list above the Details.

  • Click the 

     button above the list to display a pop-up version of the Details.

Step 3

Click a 

 button to save the record in the Controller database.