web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / HELP: When adding a \n...
Power Automate
Answered

HELP: When adding a \n in a compose action string and then adding it to POST Body adds additional \\

(0) ShareShare
ReportReport
Posted on by 92

Hi,

   I'm sending a POST with HTTP.   before sending the POST I generated a Compose to add some New Lines. The odd thing here is that if I add the text directly in the Body of the POST it works but in the result of the compose it doesn't. Not sure why.  Let me show you:

 

  1. In this screen shot you can see the body has two \n \n in the text. This works perfect when it is written directly in the body.  It creates 2 next lines (carriage returns) in the comment. In this case for ASANA we are integrating. 
    • drako_1-1644954034312.png

       

  2. The second Compose Output has the following text once executed:  This is a Test of HTML test \n This is the next line. \n<b>This is bold</b> \n
  3. When I check the body of the POST (executed, runtime) the \n that were in the output have changed to \\n. 
    • {
        "data": {
          "html_text""<body> This Comment was generated in DevOps by: <b>  John Doe </b>  \n \n  This is a Test of HTML test \\n This is the next line. \\n <b>This is bold</b> \\n </body>"
        }
      }
  4. The result in the comment is this in ASANA
    • drako_2-1644954634495.png

       

  5. You can see that the \n that were added directly in the body of HTTP POST generated the 2 lines but the ones that were "injected" by the compose output were past a plain text as for some reason another "\" was added.

  I have spend a few days on this and tried many options without success. 

Help is appreciated. 

 

Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @drako 

     

    Try the following:

     

    image.png

     

    Expression I used above is 

    replace(outputs('Compose'),'\n',decodeUriComponent('%0D%0A'))
     
    My test result:
     
    image.png
  • drako Profile Picture
    92 on at

    @abm  IT WORKED!!!!  Thanks a LOT!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard