Live Forms v7.2 is no longer supported. Click here for information about upgrading to our latest GA Release.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 122 Next »

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.

(need good example) - 

When the rule displays in the Rule Builder tab, it will indicate that the rule has been flagged to run only when the form loads, if this checkbox is checked.

Rule Builder Wizards

The Rule Builder walks you thru three easy steps 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:

 PartDescription
Field or current step (Optional)

What field or current workflow step do you want to evaluate?

 

OperatorWhat 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. Else Actions are optional as not all rules require them.

 

Add A Rule

  1. Click the Run Builder button.
  2. Click the Add Condition button to create a new condition (optional).
  3. Select your Field or aelect current step to describe an action that will execute based on the workflow step currently executing.
  4. Select your Operator.
  5. Select your Value (optional).  To enter a text value, slide the toggle switch icon to the right and a field displays to the right.
  6. Click Next to advance to the Action wizard.
  7. Specify the actions to be taken if the condition is true.
  8. Click Next to advance to the Else Action wizard
  9. Specify the actions to be taken if the condition is false.
  10. Click Finish.
  11. Save your form/flow.
  12. 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.

  1. Click the pencil icon on whatever part of the rule you want to modify.
  2. Click the up and down arrows on the right side to change the order of conditions and actions.

 

 Click here for some information about what you will see if you change the name of a control
If you change the name of a control after you have written a rule that is dependent on it, the rule becomes invalid and displays in a pink background. Click all pencil icon(s) to find the error. The Next and Previous buttons are disabled until the rule is fixed.

Delete a Rule

  1. 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. Based on the conditions that you set up for your rule, a logic expression is built and displayed at the bottom of the screen. Notice the expression uses the AND operation by default. There may be business rules that require a change to the logic expression.

  • The (AND operation) means that All of the specified conditions must be true before the actions set up in the Action Wizard are executed.
  • Change the (AND operation(s)) to (OR operation(s)) if only one of the conditions needs to be true before the actions are executed.
  • Group parts of the logic expression using parentheses if necessary.

Let's consider this example. A Travel Request workflow contains a field 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.

The business requirement for this rule is: 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 color coded 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

Rules created with the Rule Builder are automatically converted to JavaScript and co-exist with existing JavaScript rules. Of course, you can still add JavaScript directly or edit the generated code to make manual changes to your rule once you have created it with the Rule Builder.

  1. Click the Rule Code tab then click on Edit Code tab to add/edit JavaScript.

Clicking the Edit Code button permanently disables the Rule Builder for this rule.

Future Releases of the Visual Rule Builder

This is version 1 of the Rule Builder. More common rule patterns will be available in future releases.

This version of the Visual Rule Builder does not currently support screenflows that use the Navigation toolbar to move back and forth between screenflow steps.

Examples

 Click here for Example 1

Example 1:

You are designing a weekly Time Sheet that has fields where the user must enter the From and To dates for the reporting period.

Rule Requirement: If the date entered in Period To is equal to or earlier than the date entered in Period From field show this error message "Must be after From Date"

The Condition and Action wizards for this rule are show in the image.

This is how the rule displays in the Rule Builder tab.

If the user enters 3/7/2017 or a date before 3/7/2017 in the Period To field the error message displays.

 Click here for Example 2

Example 2:

You are designing an Expense Report workflow that has 3 steps:

  • Step 1 is filled in by the employee. When it is completed, the flow is routed to the employee's manager for Approval/Rejection
  • Step 2 is performed by the Manager. If the Manager approves, the workflow is routed to the Accounts Payable group for final processing.
  • Step 3 is performed by the first person in the Accounts Payable group to click the perform icon on their Task List for this workflow.

Rule Requirement: The section named Accounts Payable Only should only show if the workflow is on the Accounts Payable step. It should not be visible when the workflow is on the steps performed by the employee or the manager.

The Condition, Action and Else Action wizards for this rule are show in the image.

This is how the rule displays in the Rule Builder tab.

The image shows what the user sees when the workflow navigates to the Accounts Payable step.

  • No labels