Dynamic Forms: Data validation

Data validation can be applied to any form component. The data validation of a field, are configured on the component itself, and can be found by viewing the Validation tab within the components settings.

Important: When you combine data validation with conditional logic, the data validation will only be applied when the form component is shown. 

Basic validation

  • Required: If checked, the field will be required to have a value upon submission.
  • Minimum length: The minimum number of characters required to be entered for this field.
  • Regular Expression Pattern: The regular expression pattern test that the field value must pass before the form can be submitted. See regex101.com for help with writing regex expressions.

Advanced validation

You can use javascript to perform validation on a field. The way to respond is by setting the valid variable. If it is set to true then the validation passes. If you set it to a string, the validation fails and the validation message is set to whatever the valid variable is set to.

In addition, input variable is set to the value that has been entered in the field. The component variable is set to the definition of the field.

You can also reference other resources and properties for validation. For example, if there is a user resource with a password field, you can use its value with user.password

Momentum