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 / HTML to text not retur...
Power Automate
Answered

HTML to text not returning entire email Body

(0) ShareShare
ReportReport
Posted on by 4

Newbie here...please be gentle.  Ultimate goal is to extract 4 fields from each email in a folder and add them as a row in an excel table.  I believe I can figure everything out as there are good example videos and articles out there.  However, because in our shop every external email gets amended with a warning banner immediately following the <body> tag, the action is cutting off the body of the original email.  Testing shows that the conversion from HTML to text cuts off the Body immediately after the warning banner.  I confirmed this by manually editing one of the emails by deleting all the banner text and the part of the Body I expected was displayed as an output of the action.  As there are potentially hundreds of emails to process in this way manual editing to remove the banner message is not practical.

 

Here is the raw HTML being passed to the HTML to text action in my flow:

 

<p><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p class="MsoNormal"></p>
<center><span style="color:#9C6500"></span>
<p></p>
<p class="MsoNormal" style="background:#FFEB9C"><span style="color:black"><b>*EXTERNAL EMAIL*</b> This email originated outside of KCHA. Do
<b>NOT</b> click or open unexpected links or attachments. <b>*NEVER*</b> provide User ID or Password. If this email seems suspicious, click your
<b>PHISH ALERT</b> button (or forward to HelpDesk@kcha.org from your cell phone).
</span></p>
<p class="MsoNormal"><span style="color:#1F497D"></span></center>
</p>
<div>
<p>Dear Suzanne Mai,<br>
<br>
The PIC team would like to let you know that the PIC Error you submitted below will be removed from the dashboard with the next update.<br>
<br>
PHA Code: WA002<br>
PIC Ticket Number: 2936640000<br>
Form Number:39<br>
Error Code:140<br>
<br>
Please do not reply to this email. if you have further questions, please contact your<a href="https://www.hud.gov/sites/dfiles/PIH/documents/PIC_Coach_List%20%2010_04_2022.pdf"> local PIC Coach.
</a><br>
<br>
Thank you! </p>
</div>
</body>
</html>
</p>

 

And here is a screenshot of the results of running the flow:

 

GaryLeaf_0-1687965878544.png

 

Please note that the text shown in the OUTPUTS section is the complete result set.  There are no additional lines of email information produced.

 

Here are the raw outputs of the HTML to text action:

 

{
    "statusCode"200,
    "headers": {
        "Cache-Control""no-store, no-cache",
        "Pragma""no-cache",
        "Transfer-Encoding""chunked",
        "Vary""Accept-Encoding",
        "Set-Cookie""ARRAffinity=5c13bba0e3b8a45ba090f5ee092772700f346483b13304dc2c955049e535f979;Path=/;HttpOnly;Secure;Domain=conversionservice-eus.azconn-eus-003.p.azurewebsites.net,ARRAffinitySameSite=5c13bba0e3b8a45ba090f5ee092772700f346483b13304dc2c955049e535f979;Path=/;HttpOnly;SameSite=None;Secure;Domain=conversionservice-eus.azconn-eus-003.p.azurewebsites.net",
        "x-ms-request-id""15714a9b-653f-4716-99c3-4e2b0a7619d9",
        "Strict-Transport-Security""max-age=31536000; includeSubDomains",
        "X-Content-Type-Options""nosniff",
        "X-Frame-Options""DENY",
        "Timing-Allow-Origin""*",
        "x-ms-apihub-cached-response""false",
        "x-ms-apihub-obo""false",
        "Date""Wed, 28 Jun 2023 15:22:38 GMT",
        "Content-Type""text/html; charset=utf-8",
        "Expires""-1"
    },
    "body""*EXTERNAL EMAIL* This email originated outside of KCHA. Do NOT click or open\nunexpected links or attachments. *NEVER* provide User ID or Password. If this\nemail seems suspicious, click your PHISH ALERT button (or forward to\nHelpDesk@kcha.org from your cell phone).\n\n"
}
 
I considered trying to use additional Actions to remove the banner information, save the email, and process it again but I have no idea how to do that or if it is even possible.  Your thoughts?
Categories:
I have the same question (0)
  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on at

    Hi @GaryLeaf ,

     

    Try this function:

     

    skip(outputs('Compose'),add(indexOf(outputs('Compose'),')'),2))

     

    vwenjuanmsft_1-1688009701767.png

     

    Outputs:

    vwenjuanmsft_0-1688009632838.png

     

    Community Support Team _ Wenjuan Zou

    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • GaryLeaf Profile Picture
    4 on at

    Perfect!  Thank you so much.  I should be able to figure the rest of it out.  I never would have come up with a solution without your help! 

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 273 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 135 Most Valuable Professional

Last 30 days Overall leaderboard