September 10, 2020 • 8 min read
Improve Data Accuracy with Regex Validation on the CodeREADr Platform
Enhance your data collection processes with the CodeREADr platform, ideal for validating secondary scans, multiple-choice answers, and text entries. Our platform is dedicated to helping customers achieve the highest accuracy in their data collection efforts. Read more about accurate barcode scanning app.
Instructions for Custom On-Device Validation
We frequently share Custom On-Device Validation (COV) scripts, developed upon our clients’ requests, to further aid in data validation. A recent addition to our repository is a RegEx-based script for validating question answers. This script enables users to identify specific patterns in various data forms, including barcode scans, text entries, and selections. Explore our comprehensive library of COV scripts here. Below, we provide detailed instructions on how to implement RegEx validation for question answers.
CATEGORIES
SOCIAL SHARE
Step 1: Create a service
Create a service and collect data with questions as desired. The service must be on-device, not online.
Note the question ID(s) for the questions you will be validating.
Step 2: Advanced Settings
On the advanced settings step, select “Enable on-device custom validation.” In the text box, you will copy and paste this script.
Step 3: Edit the script
Edit the script so that var regex includes only the patterns you would like to use. New additions to the array should follow the following format:
“QUESTION_ID”: [new RegExp(“PATTERN”), “OPTIONAL ERROR MESSAGE”]
For example, if you want to validate that your question answer contains the string “abc”:
“1737556”: [new RegExp(“[sS]*abc[sS]*”), “This ID is not valid.”]
This versatile COV script can be employed for a variety of purposes, from validating secondary IDs to ensuring adherence to protocols. RegEx patterns are highly effective for authenticating question answers. If you encounter any issues while implementing this script or have questions about its applicability to your scenario, please reach out to us via email or LiveChat for assistance.
By integrating these steps, you can significantly improve the precision of your data validation processes, leveraging the robust capabilities of the CodeREADr platform.