About Constants

Like variables, constants are used to represent data in a Workflow. However, constants have a fixed value and cannot be modified during a Workflow's execution. A constant consists of a name and a value. When you use a constant in a Workflow step, the Server substitutes its assigned value when the Workflow runs. Constants are defined globally for each computer, and once defined are available to all Workflows on that computer.  

Constants are useful for data that may be different from computer to computer, or data that is used often and may change over time. Some examples would be user names, file locations, or e-mail addresses.  

For example, you could create a constant named ConstEmailNetAdmin and assign the network administrator's e-mail address as the value. You could use this constant in multiple Workflows where you wanted to send an e-mail notification to the network administrator. If you wanted to run such a Workflow at another location with a different network administrator, you would set up a constant of the same name at the other location and assign it whatever value you wanted. If the network administrator's e-mail address changed, you would simply change the value of the constant. The value entered will thereafter be used in all Workflows containing that constant.

To avoid conflicts with Basic key words, functions, or instructions, include distinguishing characters in the names of your constants. For example, you could start all constant names with CONST. Also, if you use many constants, you may want to use the names to categorize them. For example, you could begin all e-mail address constants with CONSTEMAIL and begin all file location constants with CONSTFILE.

Constants may be used in any step parameter by specifying the name of the constant surrounded by percent signs (%) as show in the example below.

To use a constant in an action, you can click the Insert expression button next to the entry box in the action's properties dialog box. Then select Constants, and make a selection from a list of the defined constants for the local computer. For more information, see Expression Builder.

Example

Computer 1 has Microsoft Office installed in C:\OFFICE. Computer 2 has Microsoft Office installed in D:\MSO

The Workflow can run on either computer and will find the correct file.

Related Topics

About Expressions

About Variables