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 / Decode the HTML body o...
Power Automate
Unanswered

Decode the HTML body of the email and display it as he was received in an HTML table

(0) ShareShare
ReportReport
Posted on by 1,710

Hello,

Recently, I have created a flow which triggers "When an email arrives(V3)" to do the following:
-Table array variable
-Html to text to convert the body of the email to text.
-Compose action where it's mapped the conversion of the HTML text.
-Set variable action that shows the output of this compose action.
-Create HTML table
-Finally, send an email action with the output of the HTML table and some CSS design for the table.

The problem is the output of the HTML table does not display the body design as it was received what I mean by this is the line breaks between each text how it was received from the original mail.
(So it can be more readable and understandable)

Please have a look at these screenshots so you can understand what I mean:

Original EmailOriginal EmailAfter the email was sent of the HTML tableAfter the email was sent of the HTML table

 


Besides, the output result of the HTML table shows exactly how it was received (with line breaks).
Kindly have a look at this demo that shows the Output result of the HTML table:

Demo.gif
This is my CSS code design of the HTML table:

 

 

<head>
<style>
table {
 font-family: arial, sans-serif;
 border-collapse: collapse;
 width: 100%;
}
td:first-child {
 width: 30%;
}

td:last-child{
 width: 50%;
}
td, th {
 border: 1px solid #dddddd;
 text-align: left;
 padding: 8px;
}

th:first-child {
width:30%;
}

thead tr:first-child{
width:40%;
}

tr:nth-child(even) {
 background-color: #dddddd;
}
</style>
</head>

 

 

Is it possible to display the same body format output as it was received from the original email so it can be more readable with line breaks?

Can someone please explain in detail and provide an example?

Any help will be greatly appreciated.
Thank you!

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

    Hi

    Not sure I understood the scenario. So you are receiving an HTML table inside the email body, and want to map it into another HTML table and apply a specific CSS, right?

     

    If so, the first problem is, since you are using "Convert from HTML to texxt" you are losing all HTML tags. THen if you wrap the output into an element, append it to an array, and inject it to "Create HTML table", you are building an HTML with just one row.

     

    But, again, unsure if my understanding is correct

     

  • EBMRay Profile Picture
    1,710 on at

    Hi @efialttes ,

    Concerning the first question you asked, I am already mapping and applying the specific CSS in the send an email action and the design change as expected.

    Unfortunately, even when I only map the body without converting it from HTML to text it will display as follow:

    Capture.PNG
    As I mentioned in my screenshots above, it's not showing the same format as to how it's was receiving a check this example below:

    Original Email:

     

    Dear Efialttes,
    
    I hope this message finds you well!
    Testing testing.
    
    Regards,
    Julien

     

    After the flow runs the body of this email I mentioned will display like this:

     

    Dear Efialttes,I hope this message finds you well!Testing testing.Regards,Julien

     

    I want after the flow runs display in sending an email action the same format body as it was received from the original.

    For more details please have a look at the entire flow screenshot:
    Capture.PNGCapture1.PNG

    I hope that you have got my point.

    Looking forward to your response.
    Thank you!

  • Verified answer
    efialttes Profile Picture
    14,756 on at

    @Julien2 

    Thanx for this new explanation!

    I am afraid the official Microsoft support response last summer was the following:

     

    "It is a default behavior that when using the action “Html to text”, all the line breaks and format will be removed."

    https://powerusers.microsoft.com/t5/Building-Flows/When-using-quot-HTML-to-Text-quot-line-breaks-and-spaces-become/td-p/330629

     

    There is a request to add this feature, as the thread explains you can vote it here

    https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Convert-html-to-text-while-preserving-line-breaks/idi-p/247779

     

    Sorry for the bad news

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard