Custom Data Restrictions in Customer Voice
Add Restrictions
When you add a question which requires a text-based response in Customer Voice, it is possible to add restrictions to what type of text they can respond with. You can restrict their answers to be a number, an email address, or a string in a predefined format (based on a specific regular expression also knows as RegEx) such as a passport number.
You can add restrictions to a text-based question by selecting the ellipsis (…) on the bottom right of the question. Select restrictions. Then select the restriction type.
Number
Custom
What I like about the custom restrictions apart from the awesome flexibility in what you can restrict or allow. It also allows you to customise the error message to explain what the correct format is. I won’t try to pretend I know how to write regex from scratch but this is a lot of googling, tweaking, trial and error. I learn best from examples but a few basics of regular expressions here:
[A-Za-z] all letters (uppercase and lowercase)
[^0-9] all non-digit characters
[0-9] all digits
^ Start of string or start of line (unless [^inside brackets], it means "not")
$ End of string or end of line
Set the restriction type to ‘Custom’ - this will unveil a section for your RegEx code and also a section for your customised message to guide the user to the desired format.
Dates
There is the option for a ‘Date’ type question response, however it forces the use of a date pickers which can be cumbersome for selecting dates which are a long time in the past e.g. date of birth or a long time in the future e.g. passport expiry date. Allowing the user to safely enter a string in a predefined format is a better option.
Phone Numbers
Obviously this varies hugely by region and also the preference if you want to customer to enter the country code also e.g. +61 but here are a few examples of some Australian phone number regex
Australian mobile number
Australian landline phone number
Australian mobile number or landline phone number - you can combine multiple expressions with an ‘or’ statement as below to allow either a mobile or landline phone number in a single answer
Email addresses
Comma separated email addresses
Personal Identification
It is really important that this data is answered correctly and in full so this is where the custom restrictions get really important. These can also be very regional but here are a few standard Australian examples that you could perhaps use and tweak to your specific format
Medicare number - 10 digits only
Medicare position on card or IRN number - Single digit
CRN pension number - 9 digits long followed by a single letter e.g. 123456789A.
DVA pension number - 2 letters, 6 numbers, 1 letter e.g. NX213837A
Any Australian pension number - again combining the expressions as below to allow either the DVA or the CRN number in a single answer
Residential referral code - begins with 1- followed by a series of numbers e.g. 1-2833837362
I hope this has inspired you to get a little more snazzy with your customer voice surveys. I know these expressions won’t be as helpful to our non-Australian friends but maybe you can tweak the ones here or there are heaps of resources out there which can help you as RegEx has been around since the year 1951
Questions, comments etc. always welcome ☺