问题
In Azure Data Factory, I have Lookup activity. "Lookup" activity, which reads the JSON Data from SQL DB (more than 1 row) and bring into ADF Pipeline.
The lookup activity output contains escape character. Please see this:
{\ "resourceType\ ":\ "counter","id" :\ "9i5W6tp-JTd-24252\ "
How to remove escape character? Any help is appreciated.
回答1:
Since your query result is an JSON String array, we need to do more to remove escape character.
Here is my steps:
Firstly, we can define two array type variables.
Here is the summary, the Lookup activity will return an JSON String array. Here is the output of my Lookup activity.The data structure will affect the following expression at the Append variable inside the Foreach activity.
At the ForEach activity we can use
@activity('Lookup1').output.value
to get the JSON String array.Inside the ForEach activity, we can use
@json(item().value)
to get the one object of the JSON String array and remove escape character.In the end, we can use a SetVariable activity to check the result.
After I run debug. We can see the correct result:
来源:https://stackoverflow.com/questions/64713152/how-to-remove-escape-character-at-an-json-string-array