Solved
Transfom JSON with Jolt
Hi all, I would like to change the name of objects and add values to the following JSON file.
[
{
"Ean": 4052269532309,
"Bestand": 0
},
{
"Ean": 4052269532316,
"Bestand": 0
},
{
"Ean": 4052269532323,
"Bestand": 0
}
]
The result of my specification is not what I expect.
JOLT Script:
[
{
"operation": "shift",
"spec": {
"*": {
"Ean": "gtin",
"ean": "gtin",
"EAN": "gtin",
"EanCode": "gtin",
"EAN-Code": "gtin",
"EANCode": "gtin",
"Ausdr1": "gtin",
"Bestand": "qty",
"Menge": "qty",
"Stock": "qty",
"stock": "qty",
"Verfügbare Menge (Kennzahl)": "qty",
"Verfügbare Menge": "qty"
}
}
},
{
"operation": "modify-default-beta",
"spec": {
"update_date": "2022-11-03",
"supplier_name": "demo",
"file_name": "test"
}
}
]I get this result:
{
"gtin" : [ 4052269532309, 4052269532316, 4052269532323 ],
"qty" : [ 0, 0, 0 ],
"update_date" : "2022-11-03",
"supplier_name" : "demo",
"file_name" : "test"
}
I expect that:
[
{
"gtin": 4052269532309,
"qty": 0,
"update_date" : "2022-11-03",
"supplier_name" : "demo",
"file_name" : "test"
},
{
"gtin": 4052269532316,
"qty": 0,
"update_date" : "2022-11-03",
"supplier_name" : "demo",
"file_name" : "test"
},
{
"gtin": 4052269532323,
",
"update_date" : "2022-11-03",
"supplier_name" : "demo",
"file_name" : "test"": 0,
"update_date" : "2022-11-03",
"supplier_name" : "demo",
"file_name" : "test"
}
]Does anyone have an idea how I can customize it? Thanks for help

