The Visual Rules Builder enables non-technical designers to add dynamic behaviors to a form/flow. Here are several behaviors that you can create:
- Show/Hide a Control(s) based on a specified condition
- Show/Hide Steps in a flow based on the step that the flow is currently executing
- Dynamically setting default values and control properties such as valid, printable, required and more.
On this page:
When Do Rules Execute
Business Rules are executed when the form/flow loads and when a control's value that the rule depends on changes. If you want your rule to run Only when the form loads - check the Initialization Only checkbox at the top of the wizard. You may want some business logic to execute before the form/flow displays and users begin interacting with it.loads and when a control's value that the rule depends on changes. If you want your rule to run Only when the form loads - check the Initialization Only checkbox at the top of the wizard.
(need good example) -
Rule Builder Wizards
The Rule Builder walks you thru three easy step to define your condition and actions.
Condition wizard
Describe the conditions under which a set of actions should be executed. You can specify more than one condition in the same rule but you do not need a condition.
Each condition consists of the following:
Part | Description |
---|---|
Field or current step (Optional) | What field or current workflow step do you want to evaluate?
|
Operator | What condition do you want to test to see if it is true? |
Value (Optional) | What value do you want to compare the Field or current step to? |
Action wizard
Declare the actions that should be taken when the condition is true.
Else Action wizard
Declare the actions that should be taken when the condition is false.
Add A Rule
- Click the Run Builder button.
- Click the Add Condition button to create a new condition (optional).
- Select your Field or aelect current step to describe an action that will execute based on the workflow step currently executing.
- Select your Operator.
- Select your Value (optional). To enter a text value, slide the toggle switch icon to the right and a field displays to the right.
- Click Next to advance to the Action wizard.
- Specify the actions to be taken if the condition is true.
- Click Next to advance to the Else Action wizard
- Specify the actions to be taken if the condition is false.
- Click Finish.
- Save your form/flow.
- Click the Test icon to verify that your rule is working as expected.
Modify a Rule
Once completed, the entire rule can be viewed in the Rule Builder tab.
- Click the pencil icon on whatever part of the rule you want to modify.
- Click the up and down arrows on the right side to change the order of conditions and actions.
Delete a Rule
- Click the icon in the Rules Validator next to the rule you want to delete. You will be asked to confirm.
Multiple Conditions in a Rule
The Rule Builder allows you to create a rule that has more than one condition. In this way, you can write a rule that performs actions based on the values of more than one field. There is just one additional step to consider. When you use multiple conditions in a rule, you can edit the logic expression to specify
- All the conditions must be true (AND operation) - Ex: 1 and 2 and 3 and 4 and 5 and 6 and 7
- Or only one of the conditions needs to be true (OR operation) before the actions are executed. Ex: 1 or 2 or 3 or 4 or 5 or 6 or 7
- You can also group parts of the logic expression using parentheses if necessary.
Let's say you have a field in a Travel Request workflow where the user selects a destination country from a dropdown. Countries that call their subdivisions "states" are: United States, Mexico, Australia, Brazil, India, Germany and Myanmar. If any of these countries are selected a Destination State field is enabled so the user can enter the Destination state. Otherwise, the Destination State field is disabled.
The Condition wizard for the business rule is shown in the image. Note that each condition is assigned a number that is reflected in the logic expression. The logic expression is built with the and operator by default. Since we want the rule to execute when any of the conditions are true, we must change all the and operations in the logic expression to the or operation.
Switching to the Rule Code Tab
This reduces the need to write code. Rules created with the Rule Builder are automatically converted to JavaScript and co-exist with existing JavaScript rules.
Of course, you can still edit add JavaScript directly or edit the generated code and make manual changes to the JavaScript. Expense Report with catagory - auto
Examples
Example 1 - Rule that manipulates controls in a form
Example 2 - Show the Accounting section on Step 3 of the workflow
This is version 1 of the Rule Builder - More common rule patterns will be available in future releases. VRB does not currently support screenflows where the nave toolbar is enabled for random navigation.