I want to generate a CSV output based on "||" as separator. I tried concatenation and other different approaches but I'm not able to achieve the desired output.
Input payload:
[
{
"details": "products' details; LED; 10-34V; 90 CRI; 300j-400h; 708-150 lm; 6 in.AVAIL",
"Id": "AgXS31456",
"age": "25"
}
]
Used script:
%dw 2.0
output application/csv header=false, separator="|"
---
payload map ((item) -> {
"field_1": item.Id ,
"field_2": item.details,
"field_3": item.age
})
Expected output:
AgXS31456||products' details; LED; 10-34V; 90 CRI; 300j-400h; 708-150 lm; 6 in.AVAIL||25
Not sure if there another way to twist the script in order to get the delimiter separator as expected.