User variables
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 dialog. The Initial
Value is only used to set the Current Value before executing
a flowchart run. It is the Current Value that 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, Campaign will not be able to resolve the user variable. 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.
- 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.