cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
adafieno
Microsoft
Microsoft

Power Virtual Agents - Rendering line breaks on bot messages

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

1 ACCEPTED SOLUTION

Accepted Solutions

@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.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

12 REPLIES 12
renatoromao
Super User
Super User

Hi @adafieno ,

 

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


Did I answer your question? Mark my post as a solution!
Thanks!

Renato Romão,

Connect with me here 😉

Power Virtual Agents course (+2.650 students) : English | Português

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
PVA
PVA

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

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.

 

 

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

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

 

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

 

%0A

 

is equals to break



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

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.

@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.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Helpful resources

Announcements
PVA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Center-of-Excellence-Starter-Kit-cropped 768x460.png

The Total Economic Impact™ of Power Virtual Agents

Read this 2021 commissioned study, conducted by Forrester Consulting.

Top Solution Authors
Users online (1,579)