Use Custom Validation to define an error condition for a field and the message to display when that condition is true.
Overview
Validation rules should match the data your business accepts. For example, a French IBAN in electronic format has 27 characters. IBAN lengths differ by country, so do not apply a 27-character requirement to every IBAN. This checks length only. Add any required country-specific format and check-digit validation separately.
The original illustration flags 1-0221-3345-67890 in Phone and user_example.com in Email as invalid for its example rules. It also shows USD 123.00 with a message requiring a value below 100. Choose the formats and limits required by your own use case.
Same goes for zip/postal codes, or tax codes. Validation rules are needed for such fields. A lot of stuff can get messed up if this kind of data is not recorded correctly, such as payments, shipments, fees. It’s a serious matter!
Phone numbers and email fields should be validated, too, because they should not accept invalid characters.
You should be able to set Date fields to accept only certain ranges of data. Such as: “you cannot input a delivery date that is before today”.
Where to set?
Custom Validation is available in the validation settings of field controls on Approval forms or List forms. Select a field control, such as Text Box, Number, or Dropdown, in the form designer and open Content > Validation.
Click Custom Validation to open its settings window.
Original help-center Validation panel button. The surrounding panel also shows Readonly, Required, Max Length, and Default Value.
How it works?
In the Custom validation pop-up window, there are 2 options to set:
Rule: Use the expression editor to define the condition that should display an error. The error message appears when this condition is true.
Error Message: Use the expression editor to set the message that will appear below the selected field control.
The original example sets Rule to Workflow Variables:Total Cost > Workflow Variables:Budget and Error Message to The total cost is over budget!. It displays Budget as 123 456 789,00 and Total Cost as 234567891.00, with the error below Total Cost. The dialog states that the message is displayed when the condition is met and provides OK and Cancel.
To learn how to use the expression editor, please refer: Understand Expression Editor.
Examples
Use regExpTest to check whether an email address or phone number matches the format your process accepts. Since Custom Validation shows an error when its Rule is true, set the error condition to the non-matching result. Test permitted, rejected, and empty values, and configure whether the field is required separately.
Test both sides of the error condition and its boundary. For a rule that reports Total Cost > Budget, use a budget of 1000 and try costs of 999, 1000, and 1001. Check that only the last value triggers this rule, then change it back and confirm the message clears. Save the design and verify the behavior in a preview or test form.

