Supplier catalogs

How to skip JSON products with invalid barcode

2026-06-29
Task

Some products in a JSON catalog have an empty or too-short barcode. The import should keep only items with a valid-looking code.

Short answer

If you only need to remove empty values, set barcode Is not empty. For format checking, use 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 JSON snapshot, select barcode inside the repeated block.

    JSON field barcode
    The selected field belongs to one repeated object.
  2. Open the value settings.

    Opening barcode settings
    The animation shows opening the field settings.
  3. Fast option: in Export conditions, select barcode, condition Is not empty, to remove products without a barcode.

    JSON condition
    This is one condition variant; the other variants do not need to be added.
  4. Strict option: use 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).

    JSON condition
    This is one condition variant; the other variants do not need to be added.

Before / after

Before

source data
{
    "products": [
        {
            "sku": "SKU-15001",
            "name": "Hudson lamp",
            "barcode": "4601234567890",
            "price": "1290.00"
        },
        {
            "sku": "SKU-15002",
            "name": "Parker chair",
            "barcode": "12345",
            "price": "8400.00"
        },
        {
            "sku": "SKU-15003",
            "name": "Harbor shelf",
            "barcode": "",
            "price": "990.00"
        }
    ]
}

After

result
{
    "products": [
        {
            "sku": "SKU-15001",
            "name": "Hudson lamp",
            "barcode": "4601234567890",
            "price": "1290.00"
        }
    ]
}

Process data faster with Eofferix

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

Sign up