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 Code128 Barcode.
  2. Set X Start to 5% and X End to 95%.
  3. Set Y Start to 34% and Y End to 54%.
  4. Set Value template to {{ 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.

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 positioned the same way: X Start and X End as percentages of the width, Y Start and Y End as percentages of the height. Because they are percentages rather than inches, the same layout fits a bigger template without rework.

{{ 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, use the autocomplete below Value template. It searches the fields available on your data and shows an example value. Click INSERT to add it with the braces already in place.

Labels with a Code128 barcode

Printed PDF • Layout JSON

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

Next Steps