Reputation: 67
Is it possible to use a variable in the "Request body" field in a Copy data activity?
This is my pipeline:
Output of "Get requestBody":
Allready full of unwanted slashes.
Output of "Set variable":
I using this expression in the "Request body" Field:
@replace(variables('requestBody'),'\','')
This is the input of "Copy data":
I cant get rid of all slashes. Is it even possible to use a variable for "Request body"?
Upvotes: 0
Views: 2601
Reputation: 67
To remove the backslashes, I had to use this:
@replace(string(variables('requestBody')), '\"', '"')
Upvotes: 0
Reputation: 5074
As your lookup
activity output returns JSON string value it includes an escape character backslash '\'.
To remove the escape character, create an array type variable and convert the lookup out to JSON array in append variable
activity as below.
Append variable
activity, get the lookup output and convert it to JSON array.@json(activity('Lookup1').output.firstrow.requestbody)
You can refer to these SO & SO threads for reference.
Upvotes: 1