Supplier catalogs

How to skip JSON variants without SKU or price

2026-06-29
Task

Inside products[].variants[], some JSON variants have an empty sku or empty price. The import should keep only complete variants.

Short answer

Open the sku value and add export conditions for the current variant: sku is not empty, and price matches [0-9]+(?:[,.][0-9]+)? (finds an integer or decimal number: one or more digits plus an optional decimal part after a dot or comma).

How to do it in Eofferix

  1. In the JSON snapshot, select sku inside the variants array.

    JSON variant sku
    The selected field belongs to a repeated product variant.
  2. Open the value settings.

    Opening sku settings
    The animation shows opening settings for the variant field.
  3. Add two conditions: sku is not empty and price matches [0-9]+(?:[,.][0-9]+)? (finds an integer or decimal number: one or more digits plus an optional decimal part after a dot or comma).

    Conditions for a JSON variant
    The conditions remove incomplete variants before export.

Before / after

Before

source data
{
    "supplier": "Northline",
    "products": [
        {
            "id": "P-5001",
            "name": "Hudson lamp",
            "variants": [
                {
                    "sku": "SKU-5001-M",
                    "size": "M",
                    "price": "24.90",
                    "stock": 12
                },
                {
                    "sku": "",
                    "size": "L",
                    "price": "24.90",
                    "stock": 3
                }
            ]
        },
        {
            "id": "P-5002",
            "name": "Parker chair",
            "variants": [
                {
                    "sku": "SKU-5002-M",
                    "size": "M",
                    "price": "",
                    "stock": 4
                },
                {
                    "sku": "SKU-5002-L",
                    "size": "L",
                    "price": "139.00",
                    "stock": 8
                }
            ]
        }
    ]
}

After

result
{
    "supplier": "Northline",
    "products": [
        {
            "id": "P-5001",
            "name": "Hudson lamp",
            "variants": [
                {
                    "sku": "SKU-5001-M",
                    "size": "M",
                    "price": "24.90",
                    "stock": 12
                }
            ]
        },
        {
            "id": "P-5002",
            "name": "Parker chair",
            "variants": [
                {
                    "sku": "SKU-5002-L",
                    "size": "L",
                    "price": "139.00",
                    "stock": 8
                }
            ]
        }
    ]
}

What to keep in mind

  • The condition scope should be the current variant, not the whole product.
  • If price can be 0, decide in advance whether that is a supplier error or a valid free item.

Process data faster with Eofferix

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

Sign up