Passing an output parameter from python to an ADF task

Sharath 46 Reputation points
2023-12-26T12:05:27.5166667+00:00

Passing an output parameter containing double quotes to ADF task shows an escape character '' added for each double quote character. This parameter is used to pass the column mapping definition for a Copy task. How do I avoid the escape character as it fails to read the json elements with the escape character included.

json

json2

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,380 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,655 questions
{count} votes

Accepted answer
  1. Aswin 472 Reputation points
    2023-12-26T18:15:14.2233333+00:00
    • This is happening because the output of the notebook activity is of string type. When this Json data is passed as string, you will get \ escape character in the data.
    • To correct this, the expression should be written like @json(activity('<notebook activity name>').output.status.Output.result.exitValue).
    • activity('<notebook activity name>').output.status.Output.result.exitValue - This will return the value of notebook activity. The data will be of String type. You can replace this expression for the output of any activity. Json()Is used for the output of above expression and that will convert the string data to Json data.

    I used the above expression in the mapping expression of copy activity and checked. Below is the result and data is without \ escape character.

    enter image description here

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.