User variables

Unica Campaign supports user variables, which can be used during process configuration when creating queries and expressions.

Guidelines for using user variables

The following guidelines apply to user variables:

  • User variables are local to the flowchart in which they are defined and used, but they have global scope within a flowchart run.
  • User variables use the following syntax: UserVar.UserVarName
  • User variables have Initial Values, which is the value assigned when a user variable is initially defined in the User variables variables dialog. The Initial value is only used to set the Current value before executing a flowchart run. It is the Current value that Unica Campaign uses during a flowchart run.
    Note: If the Current® value for a user variable is not set and you execute a process run or a branch run, Unica Campaign will not be able to resolve the user variable. Unica Campaign only sets the Current® value of a user variable to the Initial value before a flowchart run.
  • You can change the Current value of a user variable in the Derived Field window of a Select process.
  • User variables can be set to constants or to expressions, such as UserVar.myVar = Avg(UserTable.Age).
    Note: If you use an expression that returns multiple values (such as UserTable.Age+3, which will return one value for each record in the table), the user variable is set to the first value returned.
  • The length of the User Variables of type TEXT(UserVar) supports up to 512 characters..
  • When using user variables within SQL statements, do not enclose user variables in quotation marks, either single or double.
  • If you pass object names to your database (for example, if you use a user variable that contains a flowchart name), you must ensure that the object name contains only characters supported by your particular database. Otherwise, you will receive a database error.
  • The values of user variables can be passed in on process execution.
  • User variables are supported in outbound triggers.
  • User variables are supported for use in custom macros.
  • You cannot rename a user variable in the following cases:
    • You created a derived field using the user variable in a flowchart process and saved or ran the flowchart or process.
    • You created the user variable in a flowchart process and published the flowchart to Distributed Marketing.

User variable behavior with Flowchart Templates:

Copy Template:

If a flowchart template is copied and pasted then the User Variables are also copied along with template.

If specific process boxes from the template are selected, then only the User Variables used in those process boxes will get copied from the flowchart template.

If all process boxes from the template are selected, then all the User Variables used in those process boxes will get copied from the flowchart template.

If a flowchart contains user variable with the same name as a copied variable, it (UserVariable) will be overwritten by template paste operation. In this case, if the data type of the UserVariable copied from the template and existing user variable are different, then any process boxes using this user variable reference from the existing flowchart, get unconfigured.

Paste Template:

Only the user variables from copied process boxes are pasted into their respective process boxes and into the global variables section. All existing user variables remain unchanged.

If a flowchart contains user variable with the same name as a copied variable, it (UserVariable) will be overwritten by template paste operation. In this case, if the data type of the UserVariable copied from the template and existing user variable are different, then any process boxes using this user variable reference from the existing flowchart, get unconfigured.