azureazure-data-factory

How to replace a single quote with double quotes in ADF dynamic expressions


I am trying to replace single quote in a string with double quote using replace function with data factory expressions.

For example, replace single quote in the following string

hello'world ---> hello''world

@replace(pipeline().parameters.tst,''','''')

The above code is not working. Need help in fixing the code


Solution

  • You can declare a new parameter with the value ' (single quote). You can look at the following demonstration for reference.

    enter image description here

    @replace(pipeline().parameters.text,pipeline().parameters.replace_char,'"')
    

    enter image description here

    enter image description here

    NOTE: The \ in the output variable value indicates that the " is to be considered as a character inside the string value.