Adding validation to fields on a form
You can validate the values of fields on a form. By using validation, you can prevent a case from moving to the next step in the life cycle when the user input does not meet the required conditions.
For example, you can ensure that a customer name, address, and phone number are provided before a customer places a product order.
-
In the navigation panel, click Cases, and then click the name of a case type.
-
On the Workflow tab, click Life cycle.
-
Click an assignment.
-
Click Configure view .
-
Click the Conditions tab.
Click +Add condition.
- In the Message field, enter the text to display when validation fails.
-
Define the validation conditions for each field on the form by doing the following:
-
From the Field list, select the name of a field that supports validation.
-
From the Comparator list, select a comparator.
-
In the Value field, enter a value to compare with the user input, if applicable.
-
Add an AND operator to use another
property in the expression. If all properties meet the defined criteria, the condition passes.
Complete the following steps:
-
Click the Plus icon next to the field after which you want to add the AND operator.
-
Select AND from the first list in the new row.
-
From the Field list, select the name of a field that supports validation.
-
From the Comparator list, select a comparator.
-
In the Value field, enter a value to compare with the user input, if applicable.
-
Optional: Add multiple AND operators to include multiple properties in the expression.
-
-
Add an OR operator to use another
property in the condition. If either property meets the defined criteria, the condition passes.
Complete the following steps:
-
Click the Plus icon next to the field after which you want to insert the OR operator.
-
Select OR from the first list in the new row.
-
From the Field list, select the name of a field that supports validation.
-
From the Comparator list, select a comparator.
-
In the Value field, enter a value to compare with the user input, if applicable.
-
Optional: Add multiple AND operators to include multiple properties in the expression.
-
Optional: Add an OR operator to start a new expression.
-
-
-
Click Add condition and repeat the previous step to define more validation conditions.
- Click Done.
At run time, all validation conditions are evaluated. If any condition fails, an error message is displayed, and the form is not submitted until the user corrects the invalid fields.