Field and Object validation is crucial in maintaining data integrity when processing user input data. This post covers some exmples of field validation and object validation using regular expression patterns to catch illegal entry by the user.
To understand how to setup Field or Object validation see this blog post. This post looks at regular expression patterns as a way to validate entries.
Below is a table of all the entries that we could use for field validation.
|Pattern Type||Regex Pattern|
|Numeric characters only||
|Check for leading and trailing whitespace||
|Check for any whitespace||
|Lower case sensitivity check||
|Uppercase sensitivity check||
|Title case sensitivity check||
|Validate email is entered||
|Dangerous Html Tags||
|Western European Language Check||
|International telephone number check||
The above examples are starting points for creating both field and object validations in application composer.
From the above table let's take two examples and apply them in application composer.
As you can see the first validation rule checks for that user input in the field 'Text Field 1' only contains upper case letters. Anything else will trigger the associated error message.
The second rule checks for an international phone number input for 'Text Field 2'. So input must begin with a '+' followed by numerical digits. Spaces between the digits are allowed.
In the screenshot above you can see that the field validation rules are effective because the text entered has not met the criteria set in the rules.
For further information on this subject have a look at the following...