Id like to convert array of objects to array:
“attrs”:[
0:{
“#”:“LANGUAGE_NL”
“@attr”:“destination”
}
1:{
“#”:“LANGUAGE_DE”
“@attr”:“destination”
}
2:{
“#”:“LANGUAGE_ES”
“@attr”:“destination”
}
3:{
“#”:“LANGUAGE_FR”
“@attr”:“destination”
}
]
and I’d like:
“destination”:[LANGUAGE_NL, LANGUAGE_DE, LANGUAGE_ES …]
Like this?:
You could use Move using a pattern if you dont need to keep the original structure untouched.
(Transformer attached)
export_20250429113340.ndjson (869 Bytes)
hi, thank a lot, it looks great but “destination” should not be hardcoded :(. And there can be more attrs I do not know if it is possible in Alumio. Or go by another way. real data should be like
{
“attrs”: [
[
{ “#”: “GRAY”, “@attr”: “color” },
{ “#”: “LANGUAGE_EN”, “@attr”: “destination” }
],
[
{ “#”: “RED”, “@attr”: “color” },
{ “#”: “LANGUAGE_NL”, “@attr”: “destination” }
],
[
{ “#”: “BLUE”, “@attr”: “color” },
{ “#”: “LANGUAGE_DE”, “@attr”: “destination” }
]
]
}
and i would need
color: {GRAY, RED, BLUE}
destination: {LANGUAGE_EN, LANGUAGE_NL …}
and color and destination should not be hardcode and as well there is possibility of next attrs, for example side:{front, back}, type:{PVC, PVC-FREE} atc
Hi @vosy,
Yes, that could be possible with Alumio.
You can try this example transformer, and the output should be like this:
{
"attrs": {
"color": [
"GRAY",
"RED",
"BLUE"
],
"destination": [
"LANGUAGE_EN",
"LANGUAGE_NL",
"LANGUAGE_DE"
]
}
}
export_20250501093910.ndjson (1.1 KB)
Thanks a loooooot, it works, i have to learn it