Rules

Use Rules in forms to control the behavior of a form. Form rules provides the ability to:

  • Apply logic to forms and make them more dynamic

  • Adjust forms when user enters data

  • Display only relevant information to users

  • Improve the accuracy of data that is submitted

Here are some examples of when Rules are helpful in forms: 

  • When you want to show a set of controls only when a user is from Australia, based on a query run on the browser URL. See this example in action.

  • When you want to compare values between two of the same controls. In a form, there could be two Email fields: Email and Confirm Email. You can create a rule that checks if the user enters the same email address in these two form fields. If true, the form can be submitted. Else, an error message appears.

  • When you want to navigate a user to a different page in the form, based on their input.

  • When you want to navigate a user to a different control (on the same page or a different page) in the form, based on their input.

  • When you want to change the form's behavior based on the language used on the form. You can create a rule to display a field on the form only if a specific language name or code is used on the form.

To master the use of rules, enroll in Nintex University courses.

Types of rules

There are three types of rules you can create for forms.

Form rules

Use form rules to set behavior and values for fields. For example, when users enter data into form fields or when default values of controls determine the behavior of the form on load.

You can modify the values and behavior of form fields using form rules. For example, you want users to enter more details if they select Yes in an RSVP online form. For step-by-step instructions, see Step-by-step example: Create an RSVP form.

Note: The capability to create On form load rules is being deprecated. Existing rules will continue to be available in the On form load section, which you can update or delete. On form load rules are behaviors and values for fields that load before the user interacts with the form. For more information and guidance, see this video.

Page rules

Use page rules to set the dynamic behavior of pages in your form. For example, based on the user data entered in the form, the navigation between the pages is determined. These rules are only available if your form contains pages. For more information, see Configure pages.

Submit rules

Use submit rules to set behavior and values for fields which occur when user submits a form. You can use submit rules to set custom validation messages when submitting a form. For example, you can specify a custom validation message to be displayed if the user doesn't enter a valid value in a form field.

Add rules to your form

  1. Click Rules tab at the top of the forms designer.
  2. Decide which of the following rules you want and complete the following:
    • Form Rules: Click Add form rule to add rules to set behavior and values for fields that appear when users enter data into the form.
    • Page Rules: Click Add page rule to add rules to set the behavior of pages in the form that appear when users enter data into the form. This option is only available if your form contains pages. For more information, see Configure pages.
    • Submit Rules: Click Add submit rule to add rules to show custom validation messages, which display when users attempt a form submission.
  3. Complete the fields for the new rule as follows:
    • For Apply to, select the form or a repeating section to apply the rule to. (Available only if you have a repeating section control in the form.)
    • For Name, type a user-friendly name for your rule.
    • For If, define one or more conditions triggering the rule.
    • For Then, define one or more actions to occur if the rule is true. If you want to navigate users to a different control (on the same page or a different page) in the form, select the "Is focused" property for the rule. If you want to navigate users to a different page in the form, select the "Enable" property for the rule.
    • For Else, define one or more actions to occur if the If/Then clause is not true. If you want to navigate users to a different control (on the same page or a different page) in the form, select the "Is focused" property for the rule. If you want to navigate users to a different page in the form, select the "Enable" property for the rule.

    Note: Click Insert if you want to insert form controls, data variables, or variables with applied formulas. For more information on the Insert window, see Insert variable dialog fields, buttons, and settings. For more information on data variables, see Data variables.

  4. Click Create rule to save your configuration.
  5. To see your new rule in action, click the Preview tab on the upper left of the forms designer.

Important: If page rules are defined for a Sequential (Rule-triggered) navigation flow and you switch to another navigation flow, the page rules will display errors. You cannot publish the form until you manually delete or disable the rules.

For more information on the fields and settings of the Rule builder page, see Rule builder fields, buttons, and settings.

Search for a rule

You can search for a rule using the rule name, variable, or control name. All rules that match the search text are displayed.

  1. Click Rules tab at the top of the forms designer.
  2. Enter text in the Search box.
  3. All rules containing the rule, control, or variable name are displayed.

    To clear the search, click x on the right of the Search box.