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 / Keep H3 tags and Br Ta...
Power Automate
Unanswered

Keep H3 tags and Br Tags After Converting To HTML

(0) ShareShare
ReportReport
Posted on by 185

Hi is it possible to keep H3, br and Color tags after converting html to Text?

 

knishal_0-1665060107694.png

Once its converted I use the following expression to display the converted text:

 

replace(body('Html_to_text'), decodeuricomponent('%0A'), '')

 

Is this possible?

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,501 on at

    Hey @knishal 

    Maybe just use replace to remove everything, other than the above mentioned tags. And dont use html to text action.

  • knishal Profile Picture
    185 on at

    Possible to provide an example?

  • Sundeep_Malik Profile Picture
    6,501 on at

    @knishal 

    Can you give an example of your data, like if some name is there just write abc instead. Then I will give you the expression for it.

  • knishal Profile Picture
    185 on at
    "<p><div class=\"ExternalClass4826EE5083FE4CE5AAC7B60172F68133\"><p>​This is a long text field Test<br></p></div></p>"
     

    Above is an example of the Raw Input 

  • knishal Profile Picture
    185 on at

    This is more complex example: also there will be emails and links.

    <p><div class=\"ExternalClassF3C98F93FC8A4A7D943D998FFA9D2819\"><p>Breakfast&#160;&#160;<br></p><div> Text </div><div><br></div><div>More text​<br></div><p><br></p></div></p>"

     

     

  • knishal Profile Picture
    185 on at

    Any help? @Sundeep_Malik 

  • Sundeep_Malik Profile Picture
    6,501 on at

    @knishal 

    Way out of my league. ;(

     

    @Paulie78Might be able to help.

  • knishal Profile Picture
    185 on at

    Thank you Sundeep. @Paulie78 

    @Expiscornovus  Any help will be greatly appreciated 

     

  • Expiscornovus Profile Picture
    33,851 Most Valuable Professional on at

    Hi @knishal,

     

    The issue is that this RTE type of field adds classes to divs and other kind of tags which the SharePoint page does not like. You could use a replace function in a loop to clean-up the mark-up.

     

    In this thread I have shared an approach for that:

    https://powerusers.microsoft.com/t5/Building-Flows/Send-an-HTTP-Request-to-Sharepoint/m-p/1811447/highlight/true#M199930

     

  • srduval Profile Picture
    1,796 Moderator on at

    The first idea that comes to mind is to break the tags via find and replace prior to running it through the HTML to text. Try replacing '<h3' with '~H3~' you might have to do it on the closing tag as well. I don't know for certain what the HTML to text does, but my guess is it's a collection of regex find and replace statements that removes all the HTML tags.  

     

    If you have SQL you could probably find a similar collect of regex that you could tweak to make your own HTML to text, or office type scripts is another possible idea

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 784

#2
Valantis Profile Picture

Valantis 581

#3
Haque Profile Picture

Haque 545

Last 30 days Overall leaderboard