How to Generate a GS1-128 Barcode in a Docentric Template/D365FO?

Hello Docentric,

We are currently working on a customer labeling project where we need to integrate the GS1-128 barcode format. We’ve successfully generated a string value for a specific data field and managed to display it as a Code128 barcode. However, our customer is insisting that our implementation is not compliant with the GS1-128 barcode format.

To address this concern, we’ve explored the Designer tool, but it seems that GS1-128 barcodes are not listed among the supported barcode symbologies.

I came across an article that explains how to use barcodes with Docentric, and it also mentions the possibility of implementing the GS1-128 barcode format through custom code. However, considering our time constraints, we are keen to find an alternative solution.

Is there a way to generate GS1-128 barcodes using Docentric without resorting to custom code? Your guidance and support would be greatly appreciated. Thank you!

Hello Julie,

Thank you for contacting Docentric support. We’ve tested the GS1-128 barcode requirement and found a simple and effective solution that doesn’t require any code customization :+1:

To meet the GS1-128 barcode specifications, you can modify your template/barcode tagging element by adding a prefix character 'ñ ’ (FNC1) in the binding expression.

Here’s an example of the XPath expression that does this:

concat(“ñ402”, BillOfLading/@BillOfLadingId)

In the expression above, we use the ‘ñ’ character as the prefix requested for the GS1-128 barcodes, followed by the number ‘402’, and then add the value of the @BillOfLadingId data field. This creates a GS1-128 barcode format (below, 1), as required.

The number following the prefix serves as an example of the Application Identifier.

Implement a GS1-128 Barcode in the Report Template

Here’s how to implement this solution in your Docentric template with only a few easy clicks:

  1. Apply the existing Code128 barcode symbology available in Docentric Designer (above, 2) for the specific Barcode tagging element.
  2. Apply the XPath expression provided using the concat function to add the ‘ñ’ prefix and the requested Application Identifier to the existing custom data field that contains the string you want to display as a GS1-128 barcode.

With this adjustment, you effectively transform a Code128 barcode into a GS1-128 barcode. Given the simplicity of this approach, we haven’t introduced a dedicated GS1-128 barcode symbology in Docentric Designer.

Test the GS1-128 Barcode

After generating a preview of your template, you can validate the generated barcode to ensure it complies with the GS1-128 standard using an online barcode reader.

If you have specific requirements or need further assistance, please provide your template and specify which barcodes should adhere to the GS1-128 standard. We can then help you fine-tune the XPath expression to meet your specific needs.

Here is my test template:
WHSBillOfLading.Report_with_GS1-128_barcode.docx (120.4 KB)

Generate a GS1-128 Barcode with multiple Application Identifiers (AI)

To create a GS1-128 barcode with multiple Application Identifiers (AI) like SSCC, container count, batch number, production date, and GTIN, an XPath expression for the Barcode tagging element needs to be provided to result in the correct input string.

For example, let’s consider the desired scanned barcode output string (below, 1): (02)18435083131973(11)231110(10)2230000512(37)630

To get the above output, we need to structure the corresponding input string (2) for the Barcode tagging element, which in this case, reads:
ñ0218435083131973ñ11231110ñ102230000512ñ37630

Here’s how to correctly format the GS1-128 barcode input string:

  1. Eliminate the brackets indicating an AI in the desired output string (below, 1).
  2. Insert the ñ prefix character before each AI in the same string (below, 2).

Scanning the resulting barcode above accurately recognizes the Application Identifiers preceded by the prefix character, ensuring the correct interpretation of the barcode content, identifiers, and GS1 barcode format.

While the above example illustrates a simple approach, more complex input string scenarios can be addressed using the advanced XPath functions. For example:

  • Concatenating various data fields into a unified string using the concat function.
  • Specific date formatting (YYMMDD) for adding dates to the GS1 barcode, ensuring compliance with the GS1-128 date format using the format function.

Test template: GS-128-barcode-with-multiple-AIs.docx (101.3 KB)