← All posts

2026-10-20

How to Create Labels from Excel Data Files and Lookup Tables

How to Create Labels from Excel Data Files and Lookup Tables
pdf labels barcodes label merge browser based graphical layout editor google sheets addin microsoft excel addon electronic shelf labels esl barcode3 labels label editor

How to Create Labels from Excel Data Files and Lookup Tables

Your orders are in Excel. Your product names are in Excel. Your addresses are in Excel. And yet, every time you need labels, someone opens the spreadsheet, copies a row, pastes it into a template, saves a PDF, and repeats — forty times. Or worse, someone wrote a brittle script two years ago that breaks whenever a column gets renamed.

This article walks through the alternative: using an Excel file as the data source and a second Excel file (or a second sheet) as a lookup table, then producing finished labels as multi-page PDF, individual PNGs, or direct printer output — without copy-paste and without maintaining a parser.

What you’ll have at the end:

  • A data file with one row per label and a header row that becomes your field names.
  • A lookup table that resolves keys like SKU into full product names or categories.
  • A label layout in the LPSNG label studio with fields mapped to spreadsheet columns.
  • A repeatable job: change the spreadsheet, re-run, get new labels.

The Next Generation Label Printing System handles rendering, the job queue, and the output for you. If you want to transform individual field values with Python instead of plain mapping, that’s covered separately in Label Printing API for Python Developers: Field Scripting — this article stays on the spreadsheet path.

Prerequisites: What You Need Before You Start

  • An RSJ LPSNG edition with label studio and job queue access. The Cloud Solution, the Embedded Edition (a single-board computer such as a Raspberry Pi), and the Enterprise Features all expose the same core functionality.
  • Your Excel data file, one row per label — for example item number, description, price.
  • Optionally a separate lookup file (or a separate sheet) mapping a key — for example item number — to the text you actually want on the label, such as the full product name or category.
  • A label layout. Either one you built in the LPSNG label studio or an existing layout you want to feed with spreadsheet data.
  • A clear idea of which column belongs in which field. Sketch it on paper if needed; five minutes here saves an hour of remapping.

The Excel interface is documented at lpsng.rsj.de/en/excel. No local installation is required beyond your browser; your printer setup is the only local piece.

Step 1: Prepare Your Excel Data File and Lookup Table

Structure the data file with a header row, because each column header becomes a named field you can map later.

SKU,Description,Price,Quantity
A-1001,Steel bracket 40mm,4.90,1
A-1002,Steel bracket 60mm,5.40,2
A-1003,Aluminium bracket 40mm,6.10,1

Then build the lookup as a separate sheet or file with a key column and the values to merge:

[
  { "SKU": "A-1001", "ProductName": "Steel Bracket, 40 mm, galvanised", "Category": "Hardware" },
  { "SKU": "A-1002", "ProductName": "Steel Bracket, 60 mm, galvanised", "Category": "Hardware" },
  { "SKU": "A-1003", "ProductName": "Aluminium Bracket, 40 mm",        "Category": "Hardware" }
]

A few rules that prevent most downstream pain:

  • Keep keys consistent. Same spelling, same format, same case on both sides.
  • Remove merged cells and blank rows. They break column mapping and can shift the detected header row.
  • Watch leading zeros. If SKU is 0042, force the column to text in Excel — otherwise the key arrives as 42 and the lookup silently misses.
  • One file is fine. You can use the same workbook for both data and lookup by placing them on separate sheets.

Before uploading, a quick sanity check in pandas catches key mismatches early:

import pandas as pd

data   = pd.read_excel("orders-october.xlsx", sheet_name="Data",     dtype=str)
lookup = pd.read_excel("orders-october.xlsx", sheet_name="Products", dtype=str)

# Normalise the join key identically on both sides.
for df in (data, lookup):
    df["SKU"] = df["SKU"].str.strip().str.upper()

orphans = sorted(set(data["SKU"]) - set(lookup["SKU"]))
print(f"{len(data)} data rows, {len(orphans)} keys without a lookup entry")
print(orphans)

If orphans is empty, your lookup will resolve for every row.

Step 2: Design or Open Your Label Layout in LPSNG

Open the LPSNG label studio and create a new layout or open an existing one.

  • Add text fields for descriptions and prices, barcode fields for the item number, and image fields if you want a logo or product photo.
  • Name each field meaningfully — field_product_name, field_price, field_sku — so the mapping from spreadsheet column to label field is obvious six months from now. For the barcode side, the supported 1D and 2D formats are listed at lpsng.rsj.de/en/barcode.
  • Reserve enough space. Spreadsheet values are not uniform: the first row may be a short description, the fiftieth may wrap to three lines. Leave room rather than shrinking the font later.
  • Transform values only if you need to. Formatting a price, concatenating two columns, or computing a check digit is a job for a Python script block attached to the field, documented in the Python API reference at lpsng.rsj.de/api.

Save the layout. It becomes the template for every row in your Excel file — the design work happens once.

Step 3: Map Excel Columns to Label Fields

In the LPSNG Excel interface, upload or select your workbook as the data source, then assign each column to a field. For lookup values, specify the lookup sheet or file and the key column; LPSNG resolves the lookup per row before rendering, so the label field receives the merged value, not the raw key.

The mapping UI expresses something like this — the interface writes the configuration for you:

# Illustrative shape of the mapping you configure in the Excel interface.
layout: product-label
data_source:
  file: orders-october.xlsx
  sheet: Data
fields:
  field_sku:         SKU
  field_description: Description
  field_price:       Price
lookup:
  file: orders-october.xlsx
  sheet: Products
  key: SKU
  merge:
    field_product_name: ProductName
    field_category:     Category
output:
  format: pdf

Then preview the mapping with the first few rows. Preview is where you catch an off-by-one column or a price landing in the description field — before you burn a roll of labels.

This is the managed alternative to writing a custom parser or wiring up a command-line pipeline: the mapping itself needs no code.

Step 4: Render Labels as PDF, PNG, or Send to Print

Choose your output:

  • Multi-page PDF — ideal for archiving, email, or handing to a print shop.
  • Individual PNG images — for embedding into another system or a web front end.
  • Direct print — select the printer, and the job queue processes each row as a separate label.
  • JSON — when a downstream system needs the rendered result or the resolved data rather than paper.

For automation, drive the same job from code. The web service API submits print jobs, renders single labels as PDF or PNG, and supports direct print; authentication uses OAuth2, documented at lpsng.rsj.de/en/webservice. The standalone LPSNG Player takes a package plus data in and writes PDF, PNG, JSON, or sends to a printer:

# Endpoint paths, flags and payload fields are documented on the web service
# and Player pages — the shape below is illustrative only.
curl -X POST "https://<your-lpsng-host>/…"   -H "Authorization: Bearer $LPSNG_TOKEN"   -d '{ "layout": "product-label", "data": "orders-october.xlsx", "output": "pdf" }'

lpsng-player   --package product-label   --data orders-october.xlsx   --output pdf

If your team lives in Google Sheets rather than Excel, the Google Sheets Add-on offers the same create-and-print workflow in the browser. And all rendering happens server-side — you don’t install fonts or drivers locally beyond your printer setup.

Step 5: Verify the Output and Check Lookups

Rendering successfully is not the same as rendering correctly. Check the artifacts:

  • Spot-check several labels against the source rows — first row, last row, and anything with unusual formatting.
  • Confirm lookups resolved. If the label shows A-1002 where you expected “Steel Bracket, 60 mm, galvanised”, the key didn’t match.
  • Scan a few barcodes with a reader and compare the decoded value to the intended data. How to Verify Barcodes Before Printing Labels has a fuller checklist.
  • Read the job queue. Rows that failed or were skipped appear there, usually with the offending value or script error.
  • If you attached field scripts, confirm the transformations applied — a misapplied date format is easy to miss until someone reads a label on a shelf.

Troubleshooting Common Issues

Labels print with blank fields. Check that column headers match the mapped field names exactly, and that the data file has no leading blank rows above the header. A single empty row at the top shifts everything.

A lookup returns nothing. The key columns must match on case, surrounding spaces, and leading zeros. Normalise both sides as shown in Step 1.

Barcodes scan incorrectly. Verify the barcode field is mapped to the right column, and that the chosen format can carry the data length you’re encoding.

Rendering fails for some rows only. Inspect the job queue for error messages. Common causes are a missing value the layout requires, or a script error inside a field block.

The printer receives nothing. Confirm the printer is online and selected in the output settings. For Google Cloud Print scenarios, see the Cloud Printing documentation.

FAQ

Can I use the same Excel file for both data and lookup? Yes. Place your data on one sheet and your lookup table on another sheet within the same workbook. When mapping, select the appropriate sheet for each role. Just ensure the key column used for lookups is consistent across both sheets.

Do I need to write code to map Excel columns to label fields? No. The LPSNG Excel interface provides a mapping UI where you assign spreadsheet columns to label fields. You only need code if you want to transform values — for example, formatting a price or concatenating fields — which you can do with Python script blocks attached to fields (see the Python API documentation).

What output formats can I generate from Excel data? You can generate multi-page PDFs, individual PNG images, send jobs directly to a printer, or output JSON. The web service API and the LPSNG Player support these outputs, so you can integrate rendering into your own applications.

How do I update labels when the Excel file changes? Simply re-upload the updated Excel file or re-run the job with the new data. LPSNG applies the same label layout and mapping, so you don’t need to redesign anything. The job queue will process the new rows and produce updated labels.

Conclusion: From Spreadsheet to Shelf-Ready Labels

The workflow is short: prepare your Excel data and lookup table, design the layout once, map columns to fields, render, verify. Nothing in that list requires you to write a parser or babysit a script.

Next Generation Label Printing System does the heavy lifting — rendering, job queue, lookup resolution, and output — so you can spend your time on the data instead of the plumbing. It works the same whether you produce ten labels or ten thousand, and the web service API lets other systems trigger the same jobs programmatically.

Try the Excel interface in your LPSNG edition — cloud, embedded, or enterprise — and if your team prefers spreadsheets in the browser, take a look at the Google Sheets Add-on for the same workflow in your browser.

Related posts

EU label: AI-generated content