View Categories

GS1 Barcode Conversion

Converting GS1 Application Indicators to HR Text and JSON

Introduction

GS1 standards help industry stakeholders to meet accurate and timely data requirements. The CodeREADr app allows stakeholders to scan and process GS1-formatted barcodes to selectively capture and order AIs, to show human-readable text for app users, and optionally convert to  JSON for programming Custom On-Device Validation (COV) scripts or for processing once exported.

Conversion

Configure your services (workflows) as you normally would. On the Advanced step select “Add Scanner Customization.” [Note: For Scanner Customization you need a paid plan with the Scanning Engine (SD PRO) enabled.]

Select the Scanner Mode that best suits your application and then use the copy tool at the bottom of the page to save the configuration in JSON.

Configure the output stucture (see below). Then, at the top of the page you will paste the edited JSON string in the form field after clicking the box to enter it directly.

Example Configurations

1. Example configuration with Human Readable text (the “title”) but without filtering or ordering :

"gs1_config": [ { "ai": "*", "output": "__title__ = (__ai__)__value__", "decimal": true, "separator": "\n" } ]

Here’s an example of that string added to the scanner customization script:

{
    "scanner_mode": "FRAMING",
    "sound": false,
    "gs1_config": [
        {
            "ai": "*",
            "output": "__title__ = (__ai__)__value__",
            "decimal": true,
            "separator": "\n"
        }
    ],
    "frame_resizable": true,
    "custom_size": true,
    "frame_percentage": {
        "width": "80",
        "height": "20"
    }
}

Note: “decimal”: true, “separator”: “\n” are optional.

2. Example configuration without Human Readable text (i.e. no title) but with filtering and ordering:

 "gs1_config": [ { "ai":"21", "output": "__value__"}, { "ai":"01", "output": "-__value__"} ]

If the GS1 barcode has the following AI structure (01)99300649818757(3102)001527(13)220413(21)009029130422, the above example will return the value 009029130422-99300649818757. Note that the result is filtered to not show the (3102) and (13) application identifiers and that the order of application identifiers (01) and (21) are reversed.  The “-” is there as a delimiter example.

Here’s an example of that string added to the scanner customization script:

{
  "scanner_mode": "FRAMING",
  "sound": false,
  "gs1_config": [
    {
      "ai": "21",
      "output": "__value__"
    },
    {
      "ai": "01",
      "output": "-__value__"
    }
  ],
  "frame_resizable": true,
  "custom_size": true,
  "frame_percentage": {
    "width": "80",
    "height": "20"
  }
}

3. Example configuration for JSON output

"gs1_config": []

Note: Currently the JSON format cannot be selectively filtered to specific AIs and the order is not configurable. A scan will return JSON for the entire barcode value.

Here’s an example of that string added to the original script:

{
    "scanner_mode": "FRAMING",
    "sound": false,
    "gs1_config": [],
    "frame_resizable": true,
    "custom_size": true,
    "frame_percentage": {
        "width": "80",
        "height": "20"
    }
}

Using Export Templates

Whether for human readable text or JSON, using an Export Template for your scan data can be very helpful.

An export template can be particularly useful if your app users are not just scanning GS1 barcodes.

Optional Configurations

  1. Use the COV feature noted above to alert the app-user to special conditions, e.g. item expiration, sum the weight of multiple assets, etc.  You will need a developer to write those scripts. Alternatively we can quote writing them for you if you provide a detailed description of your requirement.
  2. Filter what can be scanned using COV or Smart Scan.
  3. Batch scan up to 200 barcodes at once using Scanner Customization.