Azure Data Factory set variable add backslash before double quote.
In Azure Data Factory, I need to copy the output of a REST API, which is an array of nested JSONs, to a CSV file. I used a loop for the array and dynamic content for the copy activity's mapping.
I have a Pipelines_Mappings variable, it contains a JSON string with double quotes. Inside the loop, there is a set variable activity that manipulates this variable and changes the index in the string based on the loop index and assigns it to the Modified_Mappings variable. then I use the modified string, which is in the Modified_Mappings variable, in the copy activity. I set the mapping tab of the copy activity as @json(Modified_Mappings).
When I use the set variable to manipulate the json string, backslashes are added before each double quote. This causes issues with the JSON and the copy doesn't work correctly. How can I remove these backslashes? Here is part of the Pipelines_Mappings variable
"value": ""value": {\t{ "type": "TabularTranslator",
"source": {
"path": "$['results'][@{item()}]['id']"
},