Supplier catalogs

How to remove YML offers without a valid barcode

2026-06-29
Task

Some YML products have an empty barcode or text instead of a barcode. The import should keep only items with a valid-looking code.

Short answer

Add an export condition to offer: barcode must match regular expression ^(?:[0-9]{8}|[0-9]{12,14})$ (matches a digits-only string with length 8, 12, 13, or 14; it does not validate the check digit).

How to do it in Eofferix

  1. In the XML/YML snapshot, select the repeated offer node.

  2. Open the node settings.

    Opening offer settings
    The animation shows opening settings for the repeated product node.
  3. Add an export condition for barcode: barcode ^(?:[0-9]{8}|[0-9]{12,14})$.

    Export condition
    The condition is applied to the whole item.

Before / after

Before

source data
<yml_catalog date="2026-06-29 10:00">
  <shop>
    <offers>
      <offer id="YML-27001"><name>Hudson lamp</name><vendorCode>LA-27001</vendorCode><barcode>4601234567890</barcode><price>1290.00</price></offer>
      <offer id="YML-27002"><name>Parker chair</name><vendorCode>KR-27002</vendorCode><barcode></barcode><price>8400.00</price></offer>
      <offer id="YML-27003"><name>Harbor shelf</name><vendorCode>PN-27003</vendorCode><barcode>bad-code</barcode><price>990.00</price></offer>
    </offers>
  </shop>
</yml_catalog>

After

result
<yml_catalog date="2026-06-29 10:00">
  <shop>
    <offers>
      <offer id="YML-27001"><name>Hudson lamp</name><vendorCode>LA-27001</vendorCode><barcode>4601234567890</barcode><price>1290.00</price></offer>
    </offers>
  </shop>
</yml_catalog>

What to keep in mind

  • If you only need to remove empty values, use is not empty without a regular expression.
  • The regular expression checks the format, but not the barcode check digit.

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up