Skip to main content

Notifications

Power Automate - General Discussion
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?

  • srduval Profile Picture
    srduval 1,663 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    split the data entry into multiple fields, and create the markup yourself. So anything they type into the header box will get wrapped with <h3></h3> anything in the body would be wrapped in <p></p> create as many entries as you need distinct HTML tags

  • VictorIvanidze Profile Picture
    VictorIvanidze 11,859 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    Hi @knishal,

    did you try to replace '<h3' with '~H3~' And then execute HTML to text?

  • Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    Hi @knishal,

     

    Probably the simplest option would be to add the text without formatting and let them edit the page afterwards directly in SharePoint?

     

    From an automation point of view I cannot think of a scenario how this technically could be simplified. 

     

    You are asking to simplify the translation of one language to another language without

    A. learning the target language by the user who enters the formatted data

    B. implementing the translation logic in your flow

     

    That is kind of challenging 😁

  • knishal Profile Picture
    knishal 185 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    This works, however the user who will be creating these items does not have any technical skills/html. Do you have any advice?

  • Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    Hi @knishal,

     

    1. Disable the RTE setting in your text field.

     

    text_rtedisabled.png

     

    2. Write the mark-up yourself in the list item.

     

    Below is an example

    <strong>Hello World</strong>
    <br>
    <p><em>This my first paragraph</em></p>
    <br>
    <p>This is my next paragraph</p>

     

     

    95e157e3-1846-4fe7-8ef6-59b940ad8579.png

    3. Use the output of that field in the Send an HTTP request action.

  • knishal Profile Picture
    knishal 185 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    Still need help with this 😥

  • knishal Profile Picture
    knishal 185 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    @Expiscornovus thank you, is it possible to provide an example? 

  • Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    Hi @knishal,

     

    You could disable the RTE option on the text field and write the HTML mark-up yourself in the Multiline field of the list 😉

     

    This way you don't have to find/replace or regex the original field value.

  • knishal Profile Picture
    knishal 185 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    @Expiscornovus @srduval is there a less complicated solution for this?

  • srduval Profile Picture
    srduval 1,663 on at
    Re: Keep H3 tags and Br Tags After Converting To HTML

    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard