Skip to main content

Notifications

Community site session details

Community site session details

Session Id : yGgybSPR8KDAm99sTA4xyN
Power Automate - Building Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 4 Mar 2020 12:48:37 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!

  • Verified answer
    efialttes Profile Picture
    14,756 on 04 Mar 2020 at 14:44:24
    Re: Decode the HTML body of the email and display it as he was received in an HTML table

    @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

  • EBMRay Profile Picture
    1,710 on 04 Mar 2020 at 14:26:13
    Re: Decode the HTML body of the email and display it as he was received in an HTML table

    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!

  • efialttes Profile Picture
    14,756 on 04 Mar 2020 at 13:30:38
    Re: Decode the HTML body of the email and display it as he was received in an HTML table

    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

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,765 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started