Creating a JSON body for a Web activity fails when the Concat function re-escapes double quotes in string values. If I have a string variable when an array of JSON:
[ { "name": "gary" }, { "name": "frank" } ]
then that variable is with the Concat function added to a valid JSON:
@concat('{ "value:" ', variables('Array Values'), '}')
all the double quotes from the Array Values string are re-escaped which doesn’t play nicely with a subsequent Web activity. Wrapping the resulting string from the Concat function inside a Json function followed by a String function has no effect since the Concat already re-escaped the double quotes.
1
In ADF when you put Json or array in String variable it will escape "
by default to resolve it you need to USE @json
function directly in body of web activity.
Use @json
function to convert string to Json in appropriate format directly into web activity body.
It will pass the correct Json to web activity input as below: