Validation Conditions "check" responses to make sure they meet the constraints that you specify. Validation conditions work such that if the entered information does not meet the logic you specify, a flagged message pops up for the user and blocks them from proceeding to the next question.

For a basic validation condition you can use the Expression Builder, which is described in the Beginner Tutorial.

Whenever you are referring to the value of the question to which you are adding the validation condition, you will see the question referred to as "."

Common components of a validation condition might be the use of = , >, and <. For example:

. > 8 (the response must be greater than 8)

. =! 0 (the response cannot be 0)

. > 1 and . < 10 (the response must be greater than 1 and also less than 10)

Restricting the length of a numeric ID or text field you can use the function string-length() (for more information on functions see CommCare Functions)

Validation Message

In the Validation Messagefield, enter the desired message that will pop up if the entered information does not meet your validation condition. You can enter a different message for each language of your application. If you do not specify a validation message the user will see a generic message like "The response is out of range." It is strongly recommended to always use a useful validation message.

Examples

Icon

This Validation makes sure that the phone number entered contains 10 digits.

Complex Example

Icon

This Validation makes sure that the date of birth is both in the past, and between the ages of 10 and 59.