Article sections

    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).

    Here are simple Custom Offline Validation guidelines.

    Examples of What COV Can Do

    • The decryption of encrypted barcode data, where app users can see the decrypted result in the response and becomes part of the scan record.
    • Validating a scanned barcode against the barcode value in an associated database is a standard feature.  With COV, you can also validate the Tap to Scan barcode and a question-answer barcode against 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 Compare COV” link below.
    • Validate answers to questions using Regex. Answer submission is blocked if it doesn’t meet the criteria set in your Regex. This script works with both On-Device and Online service types. You need to enter the QUESTION_ID,  the Regex PATTERN, and optionally the ERROR MESSAGE to show to the app user. This script works with the current Android app on the Play Store.  The iOS version will support this script on Oct 20, 2020. This PDF includes the instructions for setting up this feature.
    • See the detailed examples below.

    Conditionally Capture Primary Scans

    This PDF with instructions allows you to enable multiple Regular Expressions for the purpose of capturing and/or excluding primary scans.

    Editing the script:
    var errMsg : This is the message given to the app user when the scanned value does not match the Regular Expression.
    new RegExp(“REGEX_PATTERN_HERE”) : You can enter several Regular Expressions using this format.

    A/B Compare

    The A/B Compare COV alerts the app-user when two barcodes scanned in a row match or don’t match.

    • Tap to Scan result matched to a standard question-answer.
    • Tap to Scan matched to a session question-answer.
    • Tap to Scan matched to the response text in an associated database.
    • Standard question-answer matched to the response text in an associated database.
    • Session question-answer matched to the response text in an associated database.

    The response text match can be an exact match or a substring match. To enable this, you’ll see the instructions in our Knowledgebase.


    In this COV setup, the database will be structured in a specific format so that there are kits that contain a set number of each specific item and work orders which contain a certain number of each kit type.

    This PDF with instructions includes a script to be pasted into the custom validation field on the Advanced step. It requires you to enter a question ID for your work order question and your batch quantity question.

    After uploading a database of work orders and kits, your users can enter the work order number and see a list of kits they need to complete for that order. Importantly, a user can complete many kits at a time rather than finishing each one individually. This is referred to as a batch.

    You will need to include a question that asks for a batch quantity that can be linked in the script when editing. This number indicates how many kits will be completed together.

    In this example, let’s say we have 25 kits in our work order and each kit contains an apple, an orange, and a banana. If our batch quantity is 1, the user will need to scan an apple, an orange, and a banana to complete the batch. If our batch quantity is 5, the user can scan 5 apples, 5 oranges, and 5 bananas in any order. Once all the fruits have been scanned for these 5 kits, the batch is complete.

    Finally, you’ll want to use the kitting webify document to make the code output understandable. Paste the contents of this text into the Alter Response replacement field. The pattern for this replacement is


    We also recommend disabling the response label under the “Enable custom display configuration” option using


    If you are planning to use the kitting script and need assistance or aren’t sure if the script is best for your use case, please contact us at

    Loading and Unloading

    This PDF with instructions can be used to prevent duplicates of certain assets as they are loaded onto a truck, warehouse, dock, etc. In the script, asset IDs are scanned and added to a database along with a secondary scan. Here, the second scan is a driver ID. The driver ID is added as the response text for the asset ID in the database. [Note: This script requires the “Custom Validation Middleware” feature. Email support to get access.]

    Simultaneously, duplicate checking is turned on for specified asset prefixes. Finally, this script allows for duplicate checking reset based on the device time specified.

    For unloading, the database containing the asset IDs and corresponding driver IDs can be used for a service to check that the scanned asset ID is in the database. Additionally, using A/B compare, you can check that the dealer ID for that value matches the dealer ID in the database.

    Change Response Value Based on Substring Matching

    This PDF with instructions checks your scans for a given string using RegEx. When the string matches all or part of the scanned value, the script will check your defined array for the response to give. In the example, the response gives a bin number and color for sorting assets based on their barcode value. Additionally, it gives invalid responses for any scan that does not match the other string options. The script can be used with both record-only or validate scans services as long as the service is offline. The service will work normally outside of your defined strings. Scans not in a database on a validate scans service are invalid; scans that do not match a defined string of the array on a record-only service are recorded as valid with no response.

    Conditional Overwriting

    Validation statuses are over-written when certain criteria are met. For example, a normally valid scan can change to invalid based on:

      • the answer an app-user submits to a prompt (a “Question”);
      • when it detects certain text within the scanned value;
      • when it detects certain structured text within the standard response for the scanned value.

    Here is an example for using a yes or no question. Note that the error message at the bottom can be changed as well.

    Please contact with your specific requirement. For some applications, we will quote writing the script for you.

    in Settings