Skip to content

Step 3: Add a scannable barcode

Open the Layout Builder tab. This is where you say what goes on the label, starting with the one thing every Metrc label needs.

  1. Click + at the top of the layer stack and choose Code 128 Barcode. The new layer fills the whole label.
  2. Set Layer description to Tag barcode.
  3. On the canvas above the layer stack, drag the layer's top and bottom edges to make a band across the middle of the label, a little above center, then pull each side in slightly. The readout under the canvas should say X: 5% – 95% and Y: 34% – 54%.
  4. Replace the Value template placeholder with {{ package.label }}.

Each label now carries its own package tag as a barcode. Scan one with your phone and you will read the tag number back.

To skip the dragging, paste this step's Layout JSON into Current layout JSON at the bottom of the tab. Each step's Layout JSON holds every element added so far.

A layout is a list of layout elements stacked in a layer stack. Elements later in the stack draw on top of earlier ones, and you can drag a layer by its grip to reorder it.

Every element is a rectangle. Drag the middle of the selected layer to move it and drag an edge to resize it. The readout gives its edges as percentages of the printable width and height, with Y counted down from the top. Because they are percentages rather than inches, the same layout fits a bigger template without rework.

The JSON counts Y up from the bottom instead, so Y: 34% – 54% on the readout is stored as yStartFraction: 0.46 and yEndFraction: 0.66.

{{ package.label }} is an injection. The {{ }} braces tell T3 to look up label inside the package record for that label and drop the value in. Since every entry in the data list is a different package, every barcode differs.

Instead of typing the path, clear the editor and click Insert Field in its bottom-left corner. It searches the fields your loaded data has, shows an example value for each, and inserts the one you click with the braces already in place.

Labels with a Code 128 barcode

Printed PDF • Layout JSON

Behind the scenes
{
  "name": "Tutorial label",
  "labelContentLayoutElements": [
    {
      "description": "Tag barcode",
      "elementType": "CODE128_BARCODE",
      "xStartFraction": 0.05,
      "xEndFraction": 0.95,
      "yStartFraction": 0.46,
      "yEndFraction": 0.66,
      "valueTemplate": "{{ package.label }}"
    }
  ]
}

Next Steps