Supplier catalogs

How to choose material from a JSON attributes array

2026-06-29
Task

Product characteristics are stored in a JSON attributes array: material, color, and other parameters. The import needs a separate material field.

Short answer

Open value inside attributes and add a condition on neighboring code: the simple option is Equals material. Regular expression ^material$ does the same and strictly checks an exact full match.

How to do it in Eofferix

  1. In the JSON snapshot, select value inside the repeated block.

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

    Opening value settings
    The animation shows opening the field settings.
  3. Method 1: on neighboring code, set Equals material.

    JSON condition
    This is one condition variant; the other variants do not need to be added.
  4. Method 2: regular expression ^material$ (matches a value that is exactly material) can be kept as the strict option.

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

Before / after

Before

source data
{
    "products": [
        {
            "sku": "SKU-14001",
            "name": "Hudson lamp",
            "attributes": [
                {
                    "code": "material",
                    "name": "Material",
                    "value": "steel"
                },
                {
                    "code": "color",
                    "name": "Color",
                    "value": "white"
                }
            ]
        },
        {
            "sku": "SKU-14002",
            "name": "Parker chair",
            "attributes": [
                {
                    "code": "material",
                    "name": "Material",
                    "value": "wood"
                },
                {
                    "code": "color",
                    "name": "Color",
                    "value": "black"
                }
            ]
        }
    ]
}

After

result
{
    "products": [
        {
            "sku": "SKU-14001",
            "name": "Hudson lamp",
            "material": "steel"
        },
        {
            "sku": "SKU-14002",
            "name": "Parker chair",
            "material": "wood"
        }
    ]
}

Process data faster with Eofferix

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

Sign up