
Announcements
Hello,
I am trying to figure out of it is possible to clean up the text from the email Body dynamic content when you place it into SharePoint.
Right now it looks like this mess:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif}
span.EmailStyle17
{font-family:"Calibri",sans-serif;
color:windowtext}
span.PlainTextChar
{font-family:"Calibri",sans-serif}
.MsoChpDefault
{font-family:"Calibri",sans-serif}
@page WordSection1
{margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
{}
-->
</style></head><body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word"><div class="WordSection1"><p class="MsoPlainText">Voice message is located in attached WAV file.</p><p class="MsoNormal"> </p></div></body></html>
You can try using Html to text, passing in the HTML content and see what you get. I tried it with your HTML and get the following output.
It still contains a couple of new line characters that you could easily remove if required. See expression below:
trim(replace(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'), ''))