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 / Power Automate / How to Convert Line Br...
Power Automate
Unanswered

How to Convert Line Breaks to HTML

(1) ShareShare
ReportReport
Posted on by
 

Hello All.

I am building a block schedule request form that uses Power Automate to send the Approval request then replies to the requestor with Approved/Denied and the details. The values are held in a SharePoint List. My issue is with the formatting of the block schedule. When I use the SharePoint value in the "Start and Wait for an Approval", it is formatted correctly, as you can see below, with appropriate line breaks.

 

image.png

When sending the confirmation email, however, it strips the line breaks. I'm assuming because the email is being sent in HTML.

image.png

Any recommendations how I can format this correctly so the line breaks are shown?

 

Thanks in advance.

Categories:
I have the same question (0)
  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Hi!

    Let's assume you store the source text in a variable called 'myInputString'

    I would try the following:

    -Add a 'Compose' action block, lets rename it as 'Compose NewLine', now in order to assign it value, just hit 'Enter' from your keyboard

    -Next add the following WDL expression to your email body:

    replace(variables('myInputString'),outputs('Compose_NewLine'),'<br>')

     

    Not with my laptop, unable to test. If this approach does not make the trick please share a screenshot from your new flow design

     

    Thanx!

  • animartis Profile Picture
    on at

    @efialttes 

     

    Thank you so much! I couldn't get it to work, but I know it's something I'm doing wrong.

     

    1. For the 'Compose NewLine', you said to hit enter, as in there shouldn't be an Input but it needs to recognize it as not being blank, correct?

     

    image.png

     

    2. replace(variables('myInputString'),outputs('Compose_NewLine'),'<br>')

    Do I change 'myInputString' to the field that I want to replace? 

    ex: replace(variables('triggerOutputs()?['body/Requested_x0020_Block_x0020_Sche']'),outputs('Compose_NewLine'),'<br>')

     

    I tried it both ways and it errored when saving. Two examples, different errors.

    image.png

    image.png

    Here is a screenshot of the entire flow.

     

    image.png

     

     

  • efialttes Profile Picture
    14,756 on at

    Hi again!

    "Do I change 'myInputString' to the field that I want to replace?"

    Almost! Please change variables('myInputString') to the field you wanna replace

    Hope this helps

  • animartis Profile Picture
    on at

    @efialttes Thank you for the quick reply. In the immortal words of Forrest Gump, "Stupid is, stupid does..."

     

    Worked like a charm, thank you so much!!

     

     

  • efialttes Profile Picture
    14,756 on at

    No problema. I made this same mistake when I started working with Power Automate 😅

    Glad to see issue solved. Thanx for your kindness and, Happy Flowing!

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 > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard