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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Power Virtual Agents -...
Copilot Studio
Answered

Power Virtual Agents - Rendering line breaks on bot messages

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have string values returned from Power Automate that contain line breaks expressed as "\n" within the text. I tried several alternatives to replace those with "<br>", "</br>", etc., but HTML does not seem to work.

 

Which formats are supported for line breaks?

 

Thanks,

 

Agustín

Categories:
I have the same question (0)
  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Hi @adafieno ,

     

    Did you try to use "<br />"?

  • adafieno Profile Picture
    Microsoft Employee on at

    Thanks for your answer, Renato. I did try "<br />"  and "<br/>", but no luck.

     

    powerva.png

     

    I am sure that I am missing something.

  • MarKol Profile Picture
    on at

    HTML tags won't work in WebChat control. But if you are returning text that you trying to format into multiple lines from Power Automate, you can try using markdown tags instead of HTML tags.

     

    To force a line break, try placing 2 empty spaces at the end of the String. There are generally a couple of ways to do this in markdown notation, see which one will work for you.

     

    Here are the references to markdown syntax on line breaks:

    https://www.markdownguide.org/basic-syntax/#line-breaks

    https://markdown-guide.readthedocs.io/en/latest/basics.html#line-return

  • adafieno Profile Picture
    Microsoft Employee on at

    Thanks. That doesn't work either. It just renders two spaces wherever there's a "\n" string.

     

    I need a way to insert actual line break characters into the string to render correctly in markdown. The double spaces force the new line, but it assumes that the text has a line break in the end.

     

     

  • MarKol Profile Picture
    on at

    Did you use /s/s markdown tag to indicate a double empty space?

  • adafieno Profile Picture
    Microsoft Employee on at

    Thanks. Yes, I did use "/s/s", and also "\s\s" which is what the documentation you sent me says.

     
  • cabata Profile Picture
    314 Most Valuable Professional on at

    hi @adafieno did you use encoding html https://www.w3schools.com/tags/ref_urlencode.ASP

     

    %0A

     

    is equals to break

  • adafieno Profile Picture
    Microsoft Employee on at

    Thanks for your suggestion, Christian. That type of encoding doesn't work either. 

    It seems like the problem lies within the rendering component of Power Virtual Agents. It looks like it's not able to parse and render line breaks.

  • Verified answer
    cabata Profile Picture
    314 Most Valuable Professional on at

    @adafieno did you try encoding uri? https://powerusers.microsoft.com/t5/Building-Flows/Replace-Newline-in-Flow-Expression/td-p/57333

     

    In this example the user is deleteing a line break.

     

    see in PA you an encode an decode uri, so you can replace <br> with %0A%0A and in a compose action you can see a line break the you can send your output response to PA again.

  • adafieno Profile Picture
    Microsoft Employee on at

    Thanks, Christian. That did it. Much appreciated.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 270 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 181 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard