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. Fast option: add an export condition on barcode - Is not empty if you only need to remove products without a barcode.

    Export condition
    This option checks that a value exists, but does not check the barcode format.
  4. Strict option: add an export condition on barcode - 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).

    Export condition
    This option removes empty values and text such as bad-code.

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>

Process data faster with Eofferix

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

Sign up