Supplier catalogs

How to take EAN-13 from a JSON barcodes array

2026-06-29
Task

Each JSON product has a barcodes array: an internal supplier code and EAN-13. The import needs only EAN-13.

Short answer

Open value inside barcodes and add a condition on neighboring type: regular expression ^ean13$ (matches a value that is exactly ean13).

How to do it in Eofferix

  1. In the JSON snapshot, select value inside the barcodes array.

    JSON field value
    The selected field belongs to one array item.
  2. Open the value settings.

    Opening value settings
    The animation shows opening the field settings.
  3. Add an export condition: type ^ean13$.

    JSON condition
    The condition selects the needed array item before exporting the value.

Before / after

Before

source data
{
    "products": [
        {
            "sku": "SKU-30001",
            "name": "Hudson lamp",
            "barcodes": [
                {
                    "type": "internal",
                    "value": "LA-INT-001"
                },
                {
                    "type": "ean13",
                    "value": "4601234567890"
                }
            ]
        },
        {
            "sku": "SKU-30002",
            "name": "Parker chair",
            "barcodes": [
                {
                    "type": "internal",
                    "value": "KR-INT-002"
                },
                {
                    "type": "ean13",
                    "value": "5901234123457"
                }
            ]
        }
    ]
}

After

result
{
    "products": [
        {
            "sku": "SKU-30001",
            "name": "Hudson lamp",
            "barcode": "4601234567890"
        },
        {
            "sku": "SKU-30002",
            "name": "Parker chair",
            "barcode": "5901234123457"
        }
    ]
}

What to keep in mind

  • If the supplier writes the type as EAN13, enable case-insensitive matching or expand the expression to ^(ean13|EAN13)$ (matches both spellings).
  • If the array has no ean13, the resulting barcode field will stay empty for that product.

Process data faster with Eofferix

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

Sign up