Search code examples
muledataweavemulesoft

Dataweave Escape Double Quote and , while reading a json and writing to csv


am getting json and trying to bulk load to salesforce as a csv . But am getting errors when i do that .

Any idea how to escape the characters?

Input:

[
  {
    
    "Name": ".054\" X 6' ,  Guide \\ Wire2",

   
  }
]

dw:

%dw 2.0
output application/csv escape="",quote=""
---
payload

Solution

  • Following this Bulk API v2 Salesforce Documentation, I think the Dataweave writer configuration you need is the following one:

    output application/csv quote="\"",quoteValues=true,escape="\""