在dataweave2.0中,如果有效载荷为空,则应仅打印分隔管道的标头。我试过下面的代码:
%dw 2.0
output application/csv separator='|', header=true
---
[{
field1: "",
field1: ""
}]
Output:
field1|field2|field3
|||
Desired output is only headers:
field1|field2|field3
Please guide
答案 0 :(得分:0)
%dw 2.0
[{ field1:“ field1”, field2:“ field2”
}]
尝试一下,它可能对您有用...