Introduction
Starting in TaroWorks 4.1, you can validate the length and formatting of responses to text and barcode questions. This will allow you to have more control over the information that is being sync'd into Salesforce and increase the quality of your data. Currently these validations are on the form questions of type text and barcode. Before you begin, you may want to review the order of operations of our many Form Question features.
- A. Entering Validation into a Form - All Partner Community users are linked to a Contact Record.
- B. Validation Expression Examples - Common examples of validations that can be done using this feature.
A. Entering Validation into a Form
- Open your Form.
- Add or Edit the text or barcode question for which you'd like to have validation.
- Check Add Response Validation.
- Enter your Response Validation expression. (See examples in part B)
- Enter an example of a response to this question that should pass your validation rule.
- If you see the error message below, "Response Validation entered is not a validation expression", there is an issue with the syntax of your expression. (refer to Part B)
- You can test your validation expression by inputting responses into the Example of Valid Response field.
- If you see the error message below, "Example of Valid Response does not match the Response Validation entered.", the system would not allow that input from the mobile user. In order to save, you'll need to enter an example of a response that you would expect to pass your validation.
- Save the question.
- Repeat steps 2-9 for all of the text or barcode questions that you'd like to validate.
- Save the Form.
- Publish the Form and associated Job.
- The following error message will display for any invalid responses:
B. Validation Expression Examples
Below are examples of validation expressions that you can use in your forms. You can customize the indicated character to suit your needs.
VALIDATION | EXPRESSION | EXAMPLES |
Email Address | /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+$/ | hello@taroworks.org |
First Name or Last Name (1 word between 3 and 50 characters in length) | /^[a-zA-Z]{3,50}$/ | John, Jane |
First Names or Last Names (many words between 3 and 50 characters in length) | /^[a-zA-Z áéíóúñ]{3,50}$/ |
María Bernarda, Fernández Galván |
Begins with "PP" | /^PP/ | PP1234, PP24 |
Ends with "EE" | /EE$/ | 12AFBEE, EE |
Numeric String of any length | /^[0-9]+$/ | 0123, 000 |
Numeric String of length 10 | /^[0-9]{10}$/ | 0123456789 |
Positive Integer | /^[1-9]\d*$/ | 123, 1 |
Alpha-numeric string with 7 characters | /^[a-zA-Z0-9]{7}$/ | Test123, user555 |
String with between 5 and 7 letters | /^[a-zA-Z]{3,7}$/ | JSmith, JaneDoe |
Alpha-numeric string with at least 7 characters | /^[a-zA-Z0-9]{7,}$/ | AA123456789, aaaaaaa |
Numeric string of length 13 or 17 | /^[0-9]{13}$|^[0-9]{17}$/ | 01234567890123, 12345678901234567 |
3 digits, hyphen, 2 digits, hyphen, 4 digits (social security number) | /^\d{3}-\d{2}-\d{4}$/ | 245-25-0248, 999-99-9999 |
3 letters, hyphen, 4 digits | /^[a-zA-Z]{3}-\d{4}$/ | xxx-1482, afs-9301 |
Comments
0 comments
Please sign in to leave a comment.