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. 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 this feature.

    Here are a few detailed examples with sample scripts:

    Conditionally Capture Primary Scans

    This PDF with instructions allows you to use multiple Regular Expressions (“regex”) to define what scan values can be captured. If the scanned value doesn’t match the definition, the app user will see an error message and the scan will not be recorded.

    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 Scans Matched

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

    • The primary scan (“Tap to Scan”) is matched to a standard question-answer.
    • The primary scan is matched to a session question-answer.
    • The primary scan is matched to the response text in an associated database.
    • A standard question-answer is matched to the response text in an associated database.
    • A session question-answer is 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, please review our instructions in the Knowledgebase.

    Kitting: Validate Items and Quantities in a Kit

    With this COV script, a database includes the items in the kit, the quantity of each item, the number of kits to assemble, and the kit ID.

    This PDF with instructions includes a script to be pasted into the “Enable on-device custom validation” field on the Advanced step when creating a Validate Scans service type.

    After uploading a database of 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.

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

    This PDF document includes HTML code to show the status and messages to the app use. Paste the HTML into the Advanced step’s “Alter Response” replacement field. The pattern for this replacement is:

    ^([\s\S]*?)$

    We recommend disabling the response label under the “Enable custom display configuration” option using this text:

    {"response_label":""}

    Note: This COV kitting script is a sophisticated, kit verification tool. However, if you have a limited number of kits to verify, you could instead deploy a service with an associated database of items for each kit. The app user would select the appropriate kit to start processing. A kit could include multiples of the same item using either conditional validation overrides (no-coding) or a simple COV override (simple coding). Also, duplicate checking could be enabled with a reset. If you need help, please contact us at support@codereadr.com

    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 is for online services and 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 the Response to a Scan 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 the database of a validate scans service type 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. This PDF shows a scan response HTML example.

    Conditional Overwriting of Scan Validity

    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 support@codeREADr.com with your specific requirement. For some applications, we will quote writing the script for you.

    in Settings