Check the content of a barcode

Go beyond the structure and check the content: is the expiry date far enough out? Is the GTIN the one you expect?

6 min No prior knowledge needed

A code structure first checks whether the right fields are in the barcode. Often that is not enough: the best-before date is there, but it is two days away. The article number is present, but belongs to a different product.

That is what the content check is for. It lets you define which value is expected in individual fields — and barValid reports it right at the scan when the value does not fit.

What you need

  • A code structure you have created (how to create one)
  • Knowing which value you expect — e.g. “the expiry date must be at least 30 days out”

Step by step

  1. Open the structure

    Menu → Structure editor → tap the structure you want to extend.
  2. Tap the AI rule you care about

    Under AI rules, tap the field whose content should be validated — for example 17 for the best-before date.
  3. Scroll to “Content check”

    Below “Forbidden” and “Alternative group” you find the Content check section. As long as it says No check, barValid only verifies whether the field is present — not what is in it.
  4. Choose the operator

    The operator decides how the comparison works:
    • Equal (=) — the content must match the value exactly. For fixed article numbers.
    • Contains — the content must contain the value. Handy for batches that always start with the same prefix.
    • Greater (>) and Less (<) — for numbers such as quantities or weights.
    • Older than (future) and the other date operators — for date fields such as expiry or production date.
  5. Enter the value

    Type what to compare against into Value. The date operators add a unit below — minutes, hours, days, weeks, months or years.

    Expiry example: operator Older than (future), value 30, unit days means the date in the barcode must be more than 30 days in the future. Goods that expire sooner stand out on the spot.

  6. Save and scan

    Tap Save, select the structure on the scanner and scan. If the content does not match, barValid flags exactly that field — the rest of the code stays readable, so you can see straight away which value is the problem.
    The result, field by field

Done — that’s all there is to it.

Typical checks at a glance

  • Always the same article number (AI 01): operator “Equal (=)”, value = your GTIN.
  • Batch with a fixed prefix (AI 10): operator “Contains”, value = the prefix, e.g. “DE-”.
  • Remaining shelf life at goods-in (AI 17): operator “Older than (future)”, value 30, unit days.
  • Maximum quantity per container (AI 30): operator “Less (<)”, value = your upper limit.

You will be quickest if you create one structure per use case — one for goods-in, one for final inspection — and pick the matching one at the top of the scanner.

Frequently asked questions

How do I check that a production date is recent enough?
With Younger than (past): value 7, unit days means the date may be less than 7 days old.
Which AIs can I check the content of?
Any that is part of your structure. It is most useful for article numbers, batches, quantities and date fields.
What if the field is missing from the barcode entirely?
Then the mandatory rule kicks in and barValid reports the missing field. The content check only validates content that is actually there.
Which format do I enter a date in?
The same one the barcode uses — GS1 dates are YYMMDD, so 261231 for 31 December 2026. The span-based operators (“older than”, “younger than”) simply take a number plus a unit.
Can I attach several checks to the same field?
One content check per AI rule. If you need two different ones, create two structures and pick the right one when scanning.