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 / HTML to Text Function ...
Power Automate
Unanswered

HTML to Text Function causing line break

(0) ShareShare
ReportReport
Posted on by 219

Hi,

I'm trying to do a HTML to text conversion whenever an email arrives. So I have this text that is causing a "\n" For example:

Short Description: Ceiling is leaking need to fix

But when it converts to text it shows as:

  "Short Description: Ceiling is leaking",
  "need to fix",
 
I needed to extract the specific texts from other fields but this one is causing it to move 1 line messing up the entire flow.
Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    HI @RLSid17 

     

    Correct me if I'm wrong, but do you need to remove the \n from the text? 

     

    Did you try a simple replace function, or it's a bit more complex than this? Something like:

    replace(<HTML TEXT>, '\n', '')

     

    Cheers
    Manuel

    ------------------------------------------------------------------
    If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
    Otherwise, reply to it, and the community will do its best to help you.

  • RLSid17 Profile Picture
    219 on at

    Hi @manuelstgomes 


    Yes I do need to remove the \n from that specific line only. Since it the format of the email is fixed and this line break is causing it to add one more line.

    It still reads as:


    Short Description: Ceiling is leaking

    need to fix
     
    instead of:
     

    Short Description: Ceiling is leaking need to fix

    Please take note that in the email it is showing as one complete sentence.


    I tried the function you suggested and it doesn't do anything

  • manuelstgomes Profile Picture
    6,625 on at

    HI @RLSid17 

     

    Can you check something for me? In the long string that has the whole email, can you localize the "Ceiling is leaking" and check if the character is precise "\n"? For example, it could be <br> or \\n, so we're sure it works.

     

    If not, can you please copy the small HTML section so we can replicate it and try to help you?

     

    Cheers
    Manuel

    ------------------------------------------------------------------
    If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
    Otherwise, reply to it, and the community will do its best to help you.

  • RLSid17 Profile Picture
    219 on at


    Hi @manuelstgomes 

    This is the output from the html to text conversion. I had to change the description due to our company policies but below is an example. I noticed when I triggered a different email depending on how short is the description, it would not cause a new line. So I'm guessing if it's a long description, it caused a new line just like below.
     

    "body"" \n\nShort Description: Ceiling is leaking\nneed to fix
     
    But in the original email it displays as Short Description: Ceiling is leaking need to fix.
  • RLSid17 Profile Picture
    219 on at

    Hi, 

     

    Any solutions to this?

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @RLSid17 ,

     

    I assume you have only one "column" in the body, what you need is to remove the new line tag \n from after the Description, please try below method:

    concat(first(split(<HTML TEXT>, 'Short Description')),'Short Description',replace(last(split(<HTML TEXT>, 'Short Description')),'\n','')

     

    Best regards,

  • RLSid17 Profile Picture
    219 on at

    Hi, 

    It is saying expression is invalid.

    The expression for my html to text is 'HTML_to_text' tried to change that but it is still invalid.

  • RLSid17 Profile Picture
    219 on at

    I kinda have a workaround which makes it into a 1 long string:

    replace(body('Html_to_text'),outputs('EnterKey'),'')

     

    So I needed to create several Compose Data Operation for each fields.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @RLSid17 ,

     

    I missed a closing parenthesis at the end of the formula.

    concat(first(split(<HTML TEXT>, 'Short Description')),'Short Description',replace(last(split(<HTML TEXT>, 'Short Description')),'\n',' '))

     

    Best regards,

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard