Variables
Variables are used in business processes and forms to store field and process information, including information that will not be known until the process runs.
You can use variables to:
- Create an email notification populated with field and process information.
- Route a form to a specific person based on the value of one or more fields.
- Create forms pre-populated with values entered on another form associated with the process.
- Configure reports.
Example: A Total field on a form has a corresponding variable that stores the value for the Total field. When a user fills out the form and enters $100 in the field, the variable stores that information.
Variables can be used to control which route is taken in a process, based on information that values that may be different for different process instances.
Example: Jim is building a routing decision in his process. When the value of the Total field is greater than $10,000, the form submission should be routed to a district manager. Using the field variable for the Total field in the conditional expression for this routing decision allows Jim to route the form based on the Total field's value when it is submitted.
Variables are powerful in that they allow you to work with placeholders for data that won't be available until the process runs. Watch a tutorial on using variables in the form designer.
Variable Management
Variable management is accessed from the left toolbar using the Variable Management icon:
When a variable is selected, the right pane will display where in the process the variable is used, with links to the form(s) or process object(s) where the variable is used.
Creating Variables
When you create a field, the variable for that field is also created. When editing a field, you can specify its variable name.
Editing and Deleting Variables
To edit or delete a variable
- Open the Variable Management page.
- Locate and select the variable you want to rename or delete. Variable names are not case sensitive. Click the settings button to open the Variable settings dialog.
- In the text box, type a display name for the variable.
- Click Done. The new name will propagate throughout the process.
Click Delete to delete the variable. When prompted, click Delete again to confirm. Multiple variables may be selected and deleted at the same time.
Note: Editing a variable name or deleting a variable will only take affect after the process is published. If a variable is deleted, the data from previous versions of the process will be kept.
Using Variables in the Form Designer
You can access the variables list from the form designer by clicking the Variables tab of the palette. In the Classic Designer, you can use the Show drop down menu to filter the variables shown in the list in the palette on the left, including all variables, variables only used in this form, and unused variables.
Using Variables to Create Forms
The variables from one form can be used as fields on another form within the same business process.
Example: Jim is creating an expense request form. The expense request form contains personal information as well as a Total field. The manager who approves expense requests only needs to see the Total field's value and shouldn't have access to any personal information. So Jim creates a new form for the manager's approval and drags the Total field's variable onto it. When the process runs, the variable is populated with the Total field's amount and the manager only sees the information relevant to him.
Note: Each variable can only be used on a form once. If the variable is already used on that form, it will be grayed out and cannot be added to the form again. Variables that are not grayed out are from other forms in the process and can be added to the form like fields. When this form is viewed, those variable fields will be automatically populated with the values from the other forms.
Using the Insert Variable Button with Fields
When editing the settings for a field, you may notice the Insert variables button next to the following settings.
- Field label
- Text above field
- Text below field
- Default value
- Tooltip (in the Advanced section)
These settings accept variables, so you can use them to dynamically generate instructions or default values for users. With the Insert variables button, you can use the values from field variables and process variables. You can also search for a variable using the Search variables box.
Note: Variables used for dynamic display must be populated with a value from a previous form or process step.
Using Variables in the Process Designer
In the process designer, you can use variables to represent field values and other process information, like the user who started the process, the action taken at a particular step in the process (e.g., approve, reject, submit), and comments. The Insert variables button next to a field indicates that it accepts variables. Click this button to see a list of variables that can be used.
Example: You want to assign a user task to the person who starts a process, but at the time you configure the user task, you don't know which user will start the process. You can accomplish this by using the initiator variable, which looks like: /_initiator.
Example: You want to route a form based on the value entered in a field. If you assign a variable to that field, you can use that variable as part of a conditional expression and accomplish that goal.
As mentioned above, you can use a variable to reference the action a user takes. This is especially useful in the conditional expression builder, where different paths in the process can be followed based on user actions.
Related Topics