Search code examples
azure-logic-apps

Logic apps: Using expression to remove \n


I have a logic app that sends data to another logic app.

enter image description here

the data sent will always have \n\n at the end.

how do i clean it. i've tried using the replace function but it doesnt work.

replace(triggerBody()?['command'],'\n','')

Solution

  • this works Using the following expression cleans the string recieved from the HTTP post request above.

    to reference \n the decodeUriComponent function is used where \n is represented as %0A

    replace(triggerBody()?['command'], decodeUriComponent('%0A'), '')