skip to Main Content

I have an API response which contains rn. I am not able to replace it by using replace(string, ‘rn’, ”). It does not work for it. When I use replace(string, ‘r’, ”) it replaced every word which contains r except r. Do you have any solution?

2

Answers


  1. Chosen as BEST ANSWER

    I've done it by using replace(string, decodeUriComponent(%0D%0A'), '')


  2. The approach provided by @inspiredd works. The following is the reason why replacing rn does not work in pipeline expression builder.

    • The following is the data that I have which contains the values rn. I have taken this response from look up for demonstration.

    enter image description here

    • When I enter the expression @replace(activity('Lookup1').output.value[0].error,'rn','') in set variable, it won’t give expected output because, in the pipeline activity json, the dynamic content will be considered as \r\n instead.

    enter image description here

    • You can simply edit this pipeline JSON to simply use rn instead of \r\n.

    • This will change the dynamic content as shown below:

    enter image description here

    • Running the code will give the expected result and replace the values. This is an output image for reference.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search