Hi there im trying to do the Following using Code node or any other more clever way
This is a Mock Workflow
Mock Data JSON:
[
{
"parent": "color",
"abbr": "BLA",
"attribute_value": "Black"
},
{
"parent": "color",
"abbr": "WHI",
"attribute_value": "White"
},
{
"parent": "color",
"abbr": "MAR",
"attribute_value": "Maroon"
},
{
"parent": "logo_materialor",
"abbr": "ORA FL",
"attribute_value": "Orange Fluo"
},
{
"parent": "logo_material",
"abbr": "CL",
"attribute_value": "Classic "
},
{
"parent": "logo_material",
"abbr": "FL",
"attribute_value": "Flokos"
},
{
"parent": "logo_material",
"abbr": "EM",
"attribute_value": "Embroidery"
},
{
"parent": "size",
"abbr": "XS",
"attribute_value": "Extra Small"
},
{
"parent": "logo_material",
"abbr": "BR",
"attribute_value": "Classic Brushed"
},
{
"parent": "color",
"abbr": "CHA",
"attribute_value": "Charcoal"
}
]
NODE1 JSON :
[
{
"item_Name": "Beanie-BLA",
"base_product": "Beanie",
"logo": null,
"logo_name": null,
"logo_material": null,
"logo_material_name": null,
"color": "BLA",
"color_name": null,
"logo_color": null,
"logo_color_name": null,
"size": null,
"size_name": null,
"item_group": "Beanies",
"variant_of": "Beanie"
},
{
"item_Name": "Beanie-CHA",
"base_product": "Beanie",
"logo": null,
"logo_name": null,
"logo_material": null,
"logo_material_name": null,
"color": "CHA",
"color_name": null,
"logo_color": null,
"logo_color_name": null,
"size": null,
"size_name": null,
"item_group": "Beanies",
"variant_of": "Beanie"
}
]
Wanted Result :
[
{
"item_Name": "Beanie-BLA",
"base_product": "Beanie",
"logo": null,
"logo_name": null,
"logo_material": null,
"logo_material_name": null,
"color": "BLA",
"color_name": "Black",
"logo_color": null,
"logo_color_name": null,
"size": null,
"size_name": null,
"item_group": "Beanies",
"variant_of": "Beanie"
},
{
"item_Name": "Beanie-CHA",
"base_product": "Beanie",
"logo": null,
"logo_name": null,
"logo_material": null,
"logo_material_name": null,
"color": "CHA",
"color_name": "Charcoal",
"logo_color": null,
"logo_color_name": null,
"size": null,
"size_name": null,
"item_group": "Beanies",
"variant_of": "Beanie"
}
]
What im trying to do is :
If abbr from Mock Data = a value of the JSON property from NODE1
then
matchProperty_name = attribute_value from Mock Data
For example if
abbr = âBLAâ then it matches âcolorâ:âBLAâ then i want âcolor_nameâ:attribute_value, means âcolor_nameâ:âBlackâ
Same for the other properties.
Maybe this can be done directly with other nodes but i havent found a way and with code node i failed caus eof my coding skills.