---
title: "Custom On-Device Validation"
description: "## What Is Custom On-Device Validation (COV)? Custom On-Device Validation (COV) empowers developers to write custom JavaScript scripts to validate data based on scanned barcodes, response text, and user inputs within the app. This feature is available for services set…"
url: "https://www.codereadr.com/knowledgebase/custom-validation/"
updated: "2026-08-12"
category: No Code / Low Code Settings
---

# Custom On-Device Validation

## What Is Custom On-Device Validation (COV)?

Custom On-Device Validation (COV) empowers developers to write custom JavaScript scripts to validate data based on scanned barcodes, response text, and user inputs within the app. This feature is available for services set up as Record On-Device or Validate On-Device with options for manual uploads or auto-syncing to servers (including your own). [Learn more about auto-sync here](https://www.codereadr.com/knowledgebase/auto-sync/).

To enable this feature, navigate to the Advanced Step while creating or editing a service and select Enable on-device custom validation under the Miscellaneous section. Paste your custom script or use one of the examples provided below.

For developers, [the Custom Offline Validation Guidelines PDF](https://www.codereadr.com/wp-content/uploads/2021/07/cov-on-device-20210902.pdf) offers detailed instructions on script setup for specific use cases.

## Key Features and Examples

1. Decrypt Encrypted Barcode Data
   - Display decrypted results to users in the app response.
   - Optionally, include decrypted data in the scan record.
2. Advanced Barcode Validation
   - Match primary scans against a database.
   - Validate using predefined conditions or exact/substring matches for response text.
   - Handle question-answer formats from barcode scans or manual entries. See A/B/C Barcode Matching examples below.
3. Convert HEX to ASCII
   - Enable on-device validation, then paste [the script provided in this PDF guide](https://www.codereadr.com/wp-content/uploads/2023/09/HEX-to-ASCII-COV.pdf).
4. Regex-Based Answer Validation
   - Block answer submission if it doesn’t match specified Regex patterns.
   - Specify QUESTION_ID, Regex PATTERN, and optional ERROR MESSAGE. [Check the setup instructions here](https://www.codereadr.com/wp-content/uploads/2021/05/cov_question_answer_validation.pdf).

## Detailed Use Cases

**Option 1: Conditionally Capture Scans with Regex**

- Single Barcode Scanning: Filter scans using regex to define valid patterns. Invalid scans show error messages and aren’t recorded.
  - [Example script edits](https://d3pb9c7cezktlk.cloudfront.net/wp-content/uploads/2020/10/covprimary.pdf) include customizing errMsg and defining multiple regex patterns.
- [Batch Scanning](https://www.codereadr.com/knowledgebase/barcode-scanner-configurations/): Validate up to 200 barcodes in a single view. Non-matching scans are automatically excluded. [Here is the example script](https://www.codereadr.com/wp-content/uploads/2022/10/COV_Batch_Filter.pdf).

**Option 2: A/B/C Barcode Matching**

- Alert users when two or three sequential barcode scans match (or don’t match).
- Matching options:
  - Primary scan against a database response.
  - Question-answer pairs against database responses.
  - Cross-match between question-answer values.
- Note: Substring and exact matching are supported. For multi-line barcode data, ensure the question type is set to Multi-Line Scan and [use this script](https://www.codereadr.com/knowledgebase/a-b-c-compare-script/).

-

**Option 3: Dynamic Response Changes**

- [Modify scan responses](https://d3pb9c7cezktlk.cloudfront.net/wp-content/uploads/2020/08/cargo_cove_cov.pdf) based on predefined Regex matches.
  - Example: Sort assets by barcode value and provide tailored bin and color responses. [View the PDF for instructions](https://www.codereadr.com/wp-content/uploads/2017/08/Alter-Response-HTML-Substring-Matching.pdf).

**Option 4: Scan Value Alteration**

- Adjust scanned data for:
  - Formatting.
  - Normalization for processing.
  - Value-specific responses.
  - [Follow this Step-by-step instructions](https://www.codereadr.com/wp-content/uploads/2024/08/USE_Multi-Regex-COV.pdf).

**Option 5: Conditional Validity Overrides**

- Change a scan’s validity based on:
  - [User inputs](https://d3pb9c7cezktlk.cloudfront.net/wp-content/uploads/2020/12/yesnocov.pdf).
  - [Detected patterns in scanned or response text](https://www.codereadr.com/wp-content/uploads/2021/12/UPC-Check-Digit.pdf).
  - Example: [Allow check-digit mismatches if validated by the database](https://www.codereadr.com/wp-content/uploads/2025/03/Override-Invalid-Duplicate-Status-COV.pdf).

## Enhanced User Functionality

**Custom Validity Overrides by Users**

- Temporarily pause scanning to allow manual overrides in specific scenarios.
- Example: [Overriding expired ticket validity for a fee](https://www.codereadr.com/wp-content/uploads/2024/08/USE_Custom-Validation_Override_Middleware.pdf).
- Use-case: Alert users for additional ID checks (e.g., worker credentials).

**Combining Scanned Values**

- Merge primary and secondary scans to create new records or validate against a database.
- Example: [Combine “123456789” and “abcdefghij” into “123456789abcdefghij”](https://www.codereadr.com/wp-content/uploads/2021/07/COV-Combine-1.pdf).

**Cycle Count and Inventory Verification**

- Compare manually entered counts against stored database values to validate accuracy.
- [Check the configuration instructions here](https://www.codereadr.com/wp-content/uploads/2022/08/COV_quantity_matching-1.pdf).

**Kitting Verification**

- Validate items and quantities within kits.
- Example: Batch scan apples, oranges, and bananas to complete a kit.
- [Check the guide for kitting setup here](https://www.codereadr.com/wp-content/uploads/2021/06/USE_v2_Kitting-Verification-App-Setup.pdf).

**Loading and Unloading Validation**

- Prevent duplicate scans during loading or unloading processes.
- Example: Associate asset IDs with driver IDs for tracking.
- [Check the detailed setup instructions here](https://d3pb9c7cezktlk.cloudfront.net/wp-content/uploads/2017/08/Loading-Assets-Script.pdf).

## Support and Customization

Need help customizing your scripts? [Contact support](https://www.codereadr.com/support-selection/). Our team can guide you through setup or provide a quote for complex requirements.
