Home > Nintex Forms 2013 Help and How-to > Using the Form Designer
Rules


Rules

Overview

Rules can be used to add dynamic formatting, visibility or editability changes to controls within any form based on defined conditions.

Note: For creating rules in the Responsive Forms Designer, see Rules in the Responsive Forms Designer.

Opening the Rules pane

To open the Rules pane, select the Rules button on the Nintex Forms Design Ribbon. Alternatively, select Add Rule in the Control Properties Ribbon. 

By default, the Rules pane will show only those rules which are associated with every control currently selected. To show all rules included in the form, check the "Show all rules" box.

Adding Rules

  1. Select the control or group of controls you would like to assign a rule to. 
  2. Click the Add Rule button in the Control Properties Ribbon, or the Add New Rule button in the Rules pane. 
  3. Create rule.
  4. The newly created rule will be assigned to all the controls which were selected. 

Note: Once Add new rule is selected, the rule is automatically created. To delete a rule, click on the drop-down menu beside the rule and select Delete rule.

Editing Rules

Name

The name of the selected rule. The name can be changed in the Name field on the Rules pane.

Rule Type

The type of the selected rule. Select from either formatting or validation.  

Validation

The condition that will mark the control as invalid and prevent the form from being submitted if the condition expression evaluates to TRUE. If the expression evaluates to FALSE, the rule will not be triggered. The formula builder button (to the right of the Condition field) can be used to aid construction of condition formulas.

The form will not be submitted if the validation rule evaluates to TRUE.

The rule should be applied to the control for which you want to highlight the issue. If the rule does not evaluate, a red box will appear around the relevant control. If multiple fields need to be marked as invalid, the rule can be applied to multiple controls.

Message

The message to be displayed when the validation rule is triggered.

Conditional validation rule example:

A form has two input controls, a single line of text which is called "Amount" and a multi-line text control called "Clarification". To the "Clarification" control a validation rule is added with the condition "Amount>1000&&isNullOrEmpty(Clarification)". If a user enters an amount greater than 1000 in the form, they cannot submit the form unless they have explained the expense in the "Clarification" control.

Note: Design or Full Control permissions are required to apply HTML formatting in validation rule messages. Insufficient permissions result in encoded HTML formatting. For example, the validation rule message "<b>Select quantity</b>" is formatted to appear as "Select quantity" in forms published with sufficient permissions; however, in forms published with insufficient permissions, the message appears with the encoded HTML tags ("%/ltSelect quantity%/gt").

Formatting

The condition that will trigger the rule is set in the Condition field. The formula here must resolve to the value of TRUE for the instruction on the rule to be triggered, any other value will be treated as a FALSE value and the rule will not be triggered. The formula builder button (to the right of the Condition field) can be used to aid construction of condition formulas. 

Syntax for conditions can include any variables available in the formula builder; including Item Properties and Named Controls. Runtime functions and standard mathematical symbols can be used to manipulate or compare values for the purpose of crafting a condition. In addition, the following symbols can be used as comparison operators. String literals must be contained in double quotes (e.g. Option=="High").

Symbol​ ​Meaning
==​ is equal to​
===​ is exactly equal to (value and type)​
!=​ is not equal​
!==​ is not equal (neither value or type)​
>​ is greater than​
<​ is less than​
>=​ is greater than or equal to​
<=​ is less than or equal to​
&&​ and ​
| |​ or​
!​ not​

Use the {Self} variable (available in the Named Controls tab in the Formula Builder) to reference the value in control associated to a rule within a condition. For instance, set a rule's condition to "{Self} > 5" if you want formatting to be applied to the control when it contains a value greater that 5.

Formatting 

Use Rules to modify the following formatting attributes of a control:

  • Font
  • Text size
  • Fill color
  • Text color
  • Emphasis (bold, underline, italics, strikethrough)
  • Text alignment

In addition, rules can be used to disable or hide controls. Note: When a control is hidden based on a rule, any associated labels will also be hidden.

Rule Order

To re-order the rules in the rules pane, drag and drop a rule into the desired position. Alternatively, click the drag texture on the rule you want to move and then click to where it is destined to be moved to.

Note: Rules are executed in the order they appear in the Rules pane. If a control has more than one rule applied to it, the rules will execute in the order set in the rules pane.

Additional Functions

Click on the drop-down menu next to each rule to access additional functions.

Additional Functions​ Description​
Select associated controls​

Selection of controls (and the Controls in Use pane) will be reset to all those controls on the current device layout associated with the current rule.

Add to selected controls​ Add the current rule to all of the selected controls. ​
Remove from selected controls​ Remove the current rule from all selected controls. ​
Send to top​ Rule will be moved to the top of the list of rules. ​
Send to bottom​ Rule will be moved to the bottom of the list of rules.​
Delete rule​ Rule will be deleted from the form.​

 

Rules and Repeating Sections

A control within a repeating section may be associated with rules. These rules may include conditions which refer to controls in the same repeating section or controls outside of the repeating section.  

However, controls outside the repeating section cannot include conditions which refer to controls within repeating sections; these conditions will always evaluate to FALSE.

Notifications

The "checked controls" icon will appear beside the rule title in "Show all rules" mode to indicate this rule is associated with all the controls currently selected.

An "attention" icon will appear in the formatting section of the Rules pane to indicate that some currently unselected controls are associated with this rule. This serves as a reminder that some unselected controls will be affected by any changes to this rule.

 

Rules