Reputation: 367
I am reading JSON data from SQL Database in Azure Data Factory. I have Azure Data Factory (ADF) pipeline, contains "Lookup" activity, which reads the JSON Data from SQL DB and bring into ADF Pipeline. Somehow the escape character (" \ ") get inserted in JSON data when I see at the output of Lookup activity of ADF.
For Example, the output of Lookup activity become like this: {\ "resourceType\ ":\ "Sales","id" :\ "9i5W6tp-JTd-24252\ "
Any idea how to remove the escape character from JSON in pipeline?
Update:
Thanks for the update Joseph. When I try your steps, It doesn't work for me.
After running it, I still see escape character
{
"firstRow": {
"JSONData": "{\"resourceType\":\"counter\",\"id\":\"9i5W6tp-JTd- and more
Upvotes: 4
Views: 6545
Reputation: 6063
As we know, '\' is an escape character. In your case, this symbol appears because it is used to escape one double quote inside a pair of double quotes.
For example, "\"" => """.
But it doesn't matter, we only need to convert it from string type to json type, it will automatically remove escape characters. I've created a test to verify it.
@json(activity('Lookup1').output.firstRow.value)
to convert it from string type to json type.Upvotes: 2