Creating a Form Validation Rule

Last Updated: 12/07/2015 Introduced in Verision: 2.0

Validation Rules evaluate a form value and return a “True” or “False” outcome, depending on whether the form value satisfies the rule’s condition(s). The platform includes several form validation rules, found under System > Shared Designer Elements > System Defaults > Default Form Validation Rules. To keep all form validation rules together for organizational purposes, you could create additional validation rules here (however, this is not required).

Example

In this scenario, a minimum age for an applicant is at least 18 years old. A validation rule will evaluate year of birth of the applicant against the current year and enforce this business rule for minimum age. Our example validation rule will expect a date. If the year of birth is earlier than the end date, the rule will return a truthful outcome. Otherwise, it will return false.
 Default Form Validation Rules
 

 

Navigate to System > Shared Designer Elements > System Defaults > Default Form Validation Rules, and click on Create Rule.(This requires administrator-level privileges. If you do not have this privilege, create the rule from the Designer Projects folder to which you have access, then follow the step to convert the flow to a validation flow at the end of these instructions.)
 createRule
 
 

In the resulting New Rule pop-up, name the new rule “Applicant Over Age 18”, and click OK.

As with any other rule, the rule requires input data to evaluate. In this example, the rule will evaluate data from a form field that captures a date (for date of birth). Therefore, the input to this rule is a date.

Click the Add button in the Properties panel. Enter “DOB” as the name for the input data, and select DateTime as the data type. Click OK.

 

addInput 

To function as a rule, the rule must have at least one condition. Begin building it in the Start Rule Window, by selecting the Add New Rule Step menu item. 

 

 addNewRuleStep

The rule’s only condition will test whether the date provided by DOB is earlier than (before) the current date minus 18 years. If it is true, the applicant is of valid age. Expand the DOB variable and select the Date attribute. Click Next to proceed to the next part of the condition – the operator.

 

 dobDateTime

Because DOB is of the type DateTime, date rules appear in the operators list. Expand Date Rules, and select Less Than Or Equal To as the comparison operator. Click Next to proceed to the last part of the condition – the value.

 

 lessThanOrEqualTo

Rules can compare anchors against a number of different values – constants (which never change), exposed inputs (which are extrapolated from complex data structures), null values, ignored values, converter flows, current date, or a computation of the date.

This rule requires comparison of DOB against Compute Date. To do this, select the Mapping Type “Compute Date.”

 

 mappingComputeDate
The Compute Type field value in this scenario is the default InPast, since the rule will evaluate a date of birth year that is in the past.
 
The Start field determines the date from which the computation of age will begin. Select Current Date Time for the Start Date value.
 
 computeTimeInPast
 
In the Offset field, select Constant and set the Year value to 18. This will add 18 years to the date of birth entered in the form, and make a true/false decision whether the applicant is over the age of 18 years.
 
 This completes configuration of the rule. Click Close to save the rule’s condition.
 
Save the rule by clicking the Save Rule link at the top of the Rule Designer, and exit the Rule Designer.
 
 
 
The validation rule is established in the Form Designer, from the Surface level for the form. To learn how to apply the rule, see the topic “Applying a Form Validation Rule.”
 

Additional Resources