What Is Custom On-Device Validation?
With our ‘Custom On-Device Validation’ (COV) feature, you can write your own JavaScript to validate based on the scanned barcode, the response text, and the app user’s answers to in-app prompts. The service type must be a Record On-Device or Validate On-Device with manual upload to our server or auto-sync to our server (or yours). Learn more about auto-sync here.
You will find this COV option on the Advanced Step when creating or editing a service. Look for “Enable on-device custom validation” under Miscellaneous. Copy and paste your script or one of the scripts in the examples below.
Examples of What COV Can Do
- The decryption of encrypted barcode data, where app users can see the decrypted result in the response and the result optionally becomes part of the scan record.
- Validating primary scans against the barcode values in an associated database is a standard feature. With COV, you can also validate primary scans based on predefined conditions and primary scans against question-answer barcodes for an exact match or substring match in the database’s response text. The question-answer can be from a barcode scan or from other question options, including manual entry, drop-down menus, etc. See the “A/B/C Barcode Matching” COV section below.
- Convert HEX scan values to ASCII values. On the Advanced step when creating your services check the “Enable on-device custom validation” box and then paste the script from this PDF.
- Validate answers to questions using Regex. Answer submission is blocked if it doesn’t meet the criteria set in your Regex. You need to enter the QUESTION_ID, the Regex PATTERN, and optionally the ERROR MESSAGE to show to the app user. This PDF includes the instructions for setting up Custom Offline Validation.
Here are a few detailed examples with sample scripts: