cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
colbournescott
Helper I
Helper I

HTML to text - fails

I have a flow which works successfully for most emails where we create a case in Dynamics from the email.

During this process we convert the HTML to text using the native Content conversion step.

 

For some I have received the following error:

{"Message":"TypeError: nextPrefixCallback(...).trimStart is not a function\n at D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:218:32\n at Array.map (<anonymous>)\n at formatList (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:213:6)\n at formatUnorderedList (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:249:10)\n at recursiveWalk (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\html-to-text.js:267:9)\n at D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\helper.js:62:40\n at formatInline (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:24:3)\n at recursiveWalk (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\html-to-text.js:267:9)\n at D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\helper.js:62:40\n at formatList (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:233:5)"}

 

Any idea why it fails?

Here is one of the HTML's that failed:

<p><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta content="text/html; charset=iso-8859-1"></head><body style="font-size:10pt; font-family:Verdana,Geneva,sans-serif"><p style="line-height:12.0pt; background:#FFEB9C"><b><span lang="EN-US" style="font-size:10.0pt; color:#9C6500">CAUTION:</span></b><span lang="EN-US" style="font-size:10.0pt; color:black"> This email originated from outside of ALS. Do not click links or open attachments unless you recognize the sender and are sure content is relevant to you.</span></p><div><p>Hej! Jag undrar varför jag inte fått resultat på de här asfaltproverna?</p><p>Mvh Elisabeth</p><p id="reply-intro">2021-04-13 14:53 skrev info.ta@alsglobal.com:</p><blockquote type="cite" style="padding:0 0.4em; border-left:#1010ff 2px solid; margin:0"><div id="replybody1"><style type="text/css">
<!--
#replybody1 #v1outlook a
{padding:0}
#replybody1
{width:100%!important}
#replybody1 .v1ReadMsgBody
{width:100%}
#replybody1 .v1ExternalClass
{width:100%}
#replybody1
{}
#replybody1
{margin:0;
padding:0}
#replybody1 img
{border:0;
height:auto;
line-height:100%;
outline:none;
text-decoration:none}
#replybody1 table td
{border-collapse:collapse}
#replybody1 #v1backgroundTable
{height:100%!important;
margin:0;
padding:0;
width:100%!important}
#replybody1, #replybody1 #v1backgroundTable
{background-color:#F8F8F8}
#replybody1 #v1templateContainer
{border:1px solid #DDDDDD}
#replybody1 h1, #replybody1 .v1h1
{color:#202020;
display:block;
font-family:Arial;
font-size:30px;
font-weight:bold;
line-height:100%;
margin-top:0;
margin-right:0;
margin-bottom:10px;
margin-left:0;
text-align:left}
#replybody1 h2, #replybody1 .v1h2
{color:#202020;
display:block;
font-family:Arial;
font-size:26px;
font-weight:bold;
line-height:100%;
margin-top:0;
margin-right:0;
margin-bottom:10px;
margin-left:0;
text-align:left}
#replybody1 h3, #replybody1 .v1h3
{color:#202020;
display:block;
font-family:Arial;
font-size:22px;
font-weight:bold;
line-height:100%;
margin-top:0;
margin-right:0;
margin-bottom:10px;
margin-left:0;
text-align:left}
#replybody1 h4, #replybody1 .v1h4
{color:#202020;
display:block;
font-family:Arial;
font-size:18px;
font-weight:bold;
line-height:100%;
margin-top:0;
margin-right:0;
margin-bottom:10px;
margin-left:0;
text-align:left}
#replybody1 #v1templateHeader
{background-color:#FFFFFF;
border-bottom:0}
#replybody1 .v1headerContent
{color:#202020;
font-family:Arial;
font-size:34px;
font-weight:bold;
line-height:100%;
padding:20px;
text-align:left;
vertical-align:middle}
#replybody1 .v1headerContent a:link, #replybody1 .v1headerContent a:visited, #replybody1 .v1headerContent a .v1yshortcuts
{color:#005387;
font-weight:normal;
text-decoration:underline}
#replybody1 #v1headerImage
{height:auto;
max-width:600px!important}
#replybody1 #v1templateContainer, #replybody1 .v1bodyContent
{background-color:#FFFFFF}
#replybody1 .v1bodyContent div
{color:#202020;
font-family:Arial;
font-size:14px;
line-height:110%;
text-align:left}
#replybody1 .v1bodyContent div a:link, #replybody1 .v1bodyContent div a:visited, #replybody1 .v1bodyContent div a .v1yshortcuts
{color:#005387;
font-weight:normal;
text-decoration:underline}
#replybody1 .v1bodyContent img
{display:inline;
height:auto}
#replybody1 #v1templateFooter
{background-color:#FFFFFF;
border-top:0}
#replybody1 .v1footerContent div
{color:#005387;
font-family:Arial;
font-size:12px;
line-height:125%;
text-align:center}
#replybody1 .v1footerContent div a:link, #replybody1 .v1footerContent div a:visited, #replybody1 .v1footerContent div a .v1yshortcuts
{color:#005387;
font-weight:normal;
text-decoration:underline}
#replybody1 .v1footerContent img
{display:inline}
#replybody1 .v1bodyContent table.v1dataTable
{width:100%}
#replybody1 .v1bodyContent table.v1dataTable tbody td, #replybody1 .v1bodyContent table.v1dataTable thead th
{border-collapse:collapse;
border:1px solid;
padding:6px;
color:#202020;
font-family:Arial;
font-size:12px}
#replybody1 .v1bodyContent table.v1dataTable thead th
{background-color:darkgray}
-->
</style><div><center><table id="v1backgroundTable" border="0" width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td align="center" valign="top"><table id="v1templateContainer" border="0" width="600" cellspacing="0" cellpadding="0"><tbody><tr><td align="center" valign="top"><table id="v1templateHeader" border="0" width="600" cellspacing="0" cellpadding="0"><tbody><tr><td class="v1headerContent"><img src="cid:161850044960785b61ee6b1910542614@eamiljoprovtagning.se" data-attachment-id="4719ac37-779a-4a50-a9bb-121d40dffa06" ></td></tr></tbody></table></td></tr><tr><td align="center" valign="top"><table id="v1templateBody" border="0" width="600" cellspacing="0" cellpadding="0"><tbody><tr><td class="v1bodyContent" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="20"><tbody><tr><td valign="top"><div><h1>Orderinformation för ALS Workorder ST2108663</h1><h3>Projekt: 11201011</h3><h3>&nbsp;</h3><p>Hej Elisabeth Andersson,</p><p>Bifogade är följande filer för din beställning <strong>ST2108663</strong>:</p><ul><li>ST2108663_0_SE_SRN_2_A4_ENV_210413145318_sv-SE.pdf</li></ul><br><p style="display:block">Rapportmottagare</p><ul><li><small>Elisabeth Andersson</small> <ul><li><span style="font-size:smaller">ST2108663_0_SE_SRN_2_A4_ENV_210413145318_sv-SE.pdf&nbsp;<span style="font-size:smaller">(Email)</span></span></li></ul></li><li><small>Jörgen Forslund</small> <ul><li><span style="font-size:smaller">ST2108663_0_SE_SRN_2_A4_ENV_210413145318_sv-SE&nbsp;<span style="font-size:smaller"></span></span></li></ul></li></ul></div></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td align="center" valign="top"><table id="v1templateFooter" border="0" width="600" cellspacing="0" cellpadding="10"><tbody><tr><td class="v1footerContent" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="10"><tbody><tr><td valign="top"><div><a href="https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.alsglobal.com%2F&amp;data=04%7C..." originalsrc="http://www.alsglobal.com/" shash="QrB4TNGG3E6Wqs++cjK2+y3eltXrtnX5m5Y9tF+OgygpKp4OzyICLoMakZM6ERxHK51kMWaj3x023ajNby+rQjXgryOvBcPmaJ3w6dnJCiNWjTlfHPGnFh06KBFOj0jmonqb6ZTiJrkbOteMWng1EGdZYuDfmq7XSRlSQi1SIkU=" target="_blank" rel="noopener noreferrer">www.alsglobal.com</a></div></td></tr><tr><td valign="top"><div><hr style="height:4px; color:#005387; width:100%"></div><div><span style="color:#005387; font-family:'Times New Roman'; font-size:small">R&nbsp;I&nbsp;G&nbsp;H&nbsp;T&nbsp;&nbsp;&nbsp;S&nbsp;O&nbsp;L&nbsp;U&nbsp;T&nbsp;I&nbsp;O&nbsp;N&nbsp;S&nbsp;&nbsp;&nbsp;</span> <strong><span style="color:#f8d744; font-family:'Times New Roman'; font-size:large">|</span></strong> <span style="color:#005387; font-family:'Times New Roman'; font-size:small">&nbsp;&nbsp;&nbsp;R&nbsp;I&nbsp;G&nbsp;H&nbsp;T&nbsp;&nbsp;&nbsp;P&nbsp;A&nbsp;R&nbsp;T&nbsp;N&nbsp;E&nbsp;R</span></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></center></div></div></blockquote></div></body></html></p>

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Paulie78
Super User III
Super User III

I tried this on my side, and received the same error. It is clear from the error message produced that it is the  lists in the HTML that are causing it to crash:

D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\helper.js:62:40\n at formatList

The HTML you are providing does indeed contain lists:

2021-04-19_11-03-20.png

So I used an expression to replace the HTML values <ul> </ul> <li> and </li> like this:

 

replace(
  replace(
	  replace(
	    replace(outputs('HTML'), '<ul>', ''), 
		'</ul>', ''
	  ),
	'<li>', ''), 
'</li>', '')

 

I used this in the HTML to Text action and then it works normally:

2021-04-19_11-11-40.png

I've replaced these values with nothing, but you might want to choose something else, like a line break etc. It then produces the output no problem. Seems like a bug to me.

View solution in original post

Paulie78
Super User III
Super User III

replace(
	replace(
		replace(
		  replace(
			  replace(
				replace(outputs('HTML'), '<ul>', '<br>'), 
				'</ul>', '<br>'
			  ),
			'<li>', '<br>'), 
		'</li>', '<br>'),
	'<ul type="circle">', ''),
'<li class="MsoNormal" style="color:#202020; line-height:110%">', '')

View solution in original post

12 REPLIES 12
fchopo
Super User II
Super User II

Hello @colbournescott 

You should try to remove headers sections, stylesheets and other content that no sense to be converted to text. In order to replace those values you could use the replace function, for instance.

Have a look at this video to get some ideas: Extract and parse data from an email - Power Platform Community (microsoft.com)

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Paulie78
Super User III
Super User III

I tried this on my side, and received the same error. It is clear from the error message produced that it is the  lists in the HTML that are causing it to crash:

D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\helper.js:62:40\n at formatList

The HTML you are providing does indeed contain lists:

2021-04-19_11-03-20.png

So I used an expression to replace the HTML values <ul> </ul> <li> and </li> like this:

 

replace(
  replace(
	  replace(
	    replace(outputs('HTML'), '<ul>', ''), 
		'</ul>', ''
	  ),
	'<li>', ''), 
'</li>', '')

 

I used this in the HTML to Text action and then it works normally:

2021-04-19_11-11-40.png

I've replaced these values with nothing, but you might want to choose something else, like a line break etc. It then produces the output no problem. Seems like a bug to me.

View solution in original post

Awesome - thank you very much.  Worked like a charm.  
I am not an expert in html so left it blank as you did.  If I wanted to add in line breaks instead, would it look like this?

replace(
  replace(
	  replace(
	    replace(outputs('HTML'), '<ul>', '<br>'), 
		'</ul>', '<br>'
	  ),
	'<li>', '<br>'), 
'</li>', '<br>')
Paulie78
Super User III
Super User III

Yep.

askondo
Microsoft
Microsoft

@Paulie78 @fchopo Thank you very much for all your answers to the forum.

colbournescott
Helper I
Helper I

@Paulie78 - Sorry but another one failed.  It looks like it is in a different format.  Is there something similar I can do with this?

<p><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta content="text/html; charset=iso-8859-1"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style>
<!--
@font-face
{font-family:Wingdings}
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif}
h1
{margin-top:0cm;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:22.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
h2
{margin-top:0cm;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:19.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
h3
{margin-top:0cm;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:16.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
h4
{margin-top:0cm;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:13.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
p
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif}
span.Rubrik1Char
{font-family:"Calibri Light",sans-serif;
color:#2E74B5}
span.Rubrik2Char
{font-family:"Calibri Light",sans-serif;
color:#2E74B5}
span.Rubrik3Char
{font-family:"Calibri Light",sans-serif;
color:#1F4D78}
span.Rubrik4Char
{font-family:"Calibri Light",sans-serif;
color:#2E74B5;
font-style:italic}
p.msonormal0, li.msonormal0, div.msonormal0
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif}
p.readmsgbody, li.readmsgbody, div.readmsgbody
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif}
p.externalclass, li.externalclass, div.externalclass
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif}
p.h1, li.h1, div.h1
{margin-top:0cm;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:22.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
p.h2, li.h2, div.h2
{margin-top:0cm;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:19.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
p.h3, li.h3, div.h3
{margin-top:0cm;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:16.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
p.h4, li.h4, div.h4
{margin-top:0cm;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:13.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
p.headercontent, li.headercontent, div.headercontent
{margin-right:0cm;
margin-left:0cm;
font-size:25.5pt;
font-family:"Arial",sans-serif;
color:#202020;
font-weight:bold}
p.bodycontent, li.bodycontent, div.bodycontent
{margin-right:0cm;
margin-left:0cm;
background:white;
font-size:12.0pt;
font-family:"Times New Roman",serif}
p.yshortcuts, li.yshortcuts, div.yshortcuts
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif}
p.yshortcuts1, li.yshortcuts1, div.yshortcuts1
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:#005387;
text-decoration:underline}
p.yshortcuts2, li.yshortcuts2, div.yshortcuts2
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:#005387;
text-decoration:underline}
p.yshortcuts3, li.yshortcuts3, div.yshortcuts3
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:#005387;
text-decoration:underline}
span.E-postmall35
{font-family:"Arial",sans-serif;
color:#44546A;
font-weight:normal;
font-style:normal}
.MsoChpDefault
{font-size:10.0pt}
@page WordSection1
{margin:70.85pt 70.85pt 70.85pt 70.85pt}
div.WordSection1
{}
ol
{margin-bottom:0cm}
ul
{margin-bottom:0cm}
-->
</style></head><body bgcolor="#F8F8F8" lang="SV" link="blue" vlink="purple"><p style="line-height:12.0pt; background:#FFEB9C"><b><span lang="EN-US" style="font-size:10.0pt; color:#9C6500">CAUTION:</span></b><span lang="EN-US" style="font-size:10.0pt; color:black"> This email originated from outside of ALS. Do not click links or open attachments unless you recognize the sender and are sure content is relevant to you.</span></p><div><div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">Hej,</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">Finns dessa filter sparade så att det går att beställa analys av grundämnen?</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">I så fall skulle jag vilja beställa analys av grundämnen i inhalerbart damm för filter IOM 895 och grundämnen i respirabelt damm för filter SKC 2694.</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray">Med vänlig hälsning</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:#44546A">&nbsp;</span><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:#44546A"></span></p><p class="MsoNormal"><b><span style="font-size:9.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray">Gun-Britt Berglund</span></b><span style="font-size:9.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray"></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray">Arbetsmiljöingenjör</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray">&nbsp;</span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Arial&quot;,sans-serif; color:red">AB Previa</span></b></p><p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray">A Falck Group Company</span></p><p class="MsoNormal"><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray">Besöksadress: Isafjordsgatan 22 / Kistagången 16, Kista</span><span style="font-size:8.0pt; color:#44546A"></span></p><p class="MsoNormal"><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray">Box 1094, 164 25 Kista</span><span style="font-size:8.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:#44546A"> </span><span style="font-size:8.0pt; color:#44546A"></span></p><p class="MsoNormal"><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray">Direkt 08-752 5514</span><span style="font-size:8.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:#44546A"> </span><span style="font-size:8.0pt; color:#44546A"></span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:#44546A"><a href="mailto:gun-britt.berglund@previa.se"><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif">gun-britt.berglund@previa.se</span></a></span><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A"> </span><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:gray"></span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:#44546A"><a href="https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Fu..." originalsrc="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.previa.se_&amp;d=DwMFAw&amp;c=9mghv0deYPYDGP..." shash="smlmL64S5vibe7cWE64qJobjlcuXuLXNHIpNDLcewcbbyDnrfAyznILYgDdy74Ew9hv7/bAadMQy/jUiA2JQwQD5EcIr6BEWOel1fZ9z28BnDUTlUcJU2+2LkCLu1/cfCwaSgTCxeT4CuiWuBCRbmAa0vguC7Atx7iecOrpf6Bw="><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif">www.previa.se</span></a></span><span style="color:#44546A"></span></p><p class="MsoNormal"><u><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:blue">facebook.com/abprevia</span></u></p><p class="MsoNormal"><u><span style="font-size:8.0pt; font-family:&quot;Arial&quot;,sans-serif; color:blue"><a href="https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fab-pre..." originalsrc="http://www.linkedin.com/company/ab-previa" shash="zkZbYyUY2AqlQYNFhHr7UoF/a58qWKh3u0MdV1Hl2wmoXZm4jAwtkdzQMHmV+E5QbHOYVGKzJHN5/fhmr5r6NxEkPR1N9abE+opoNe/d1q6Dq9OxSGWyIEOi9au/lW4gzQsIOa0yg5jESBej/zDDTWlnmMLJnn9KfgRck3AnAWk=">www.linkedin.com/company/ab-previa</a></span></u></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:11.0pt; font-family:&quot;Arial&quot;,sans-serif; color:#44546A">&nbsp;</span></p><div><div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif">Från:</span></b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif"> info.ta@alsglobal.com &lt;info.ta@alsglobal.com&gt; <br><b>Skickat:</b> den 1 april 2021 12:08<br><b>Till:</b> Gun-Britt Berglund &lt;Gun-Britt.Berglund@previa.se&gt;<br><b>Ämne:</b> Resultat &amp; Dataöverföring filer för ALS Arbetsorder: ST2106255 | Er referens: Ragn-Sells, Högbytorp </span></p></div></div><p class="MsoNormal">&nbsp;</p><div align="center"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%; background:#F8F8F8; border-collapse:collapse"><tbody><tr><td valign="top" style="padding:0cm 0cm 0cm 0cm"><div align="center"><table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="0" style="width:450.0pt; background:white; border-collapse:collapse; border:none"><tbody><tr><td valign="top" style="border:solid #DDDDDD 1.0pt; border-bottom:none; padding:0cm 0cm 0cm 0cm"><div align="center"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="width:450.0pt; background:white; border-collapse:collapse"><tbody><tr><td style="padding:15.0pt 15.0pt 15.0pt 15.0pt"><p class="MsoNormal"><b><span style="font-size:25.5pt; font-family:&quot;Arial&quot;,sans-serif; color:#202020"><img border="0" width="62" height="60" id="_x0000_i1025" src="cid:image001.png@01D73536.680C6D70" style="width:.65in; height:.625in" data-attachment-id="f2259616-bd70-4bbd-a719-37a111e649e3" ></span></b></p></td></tr></tbody></table></div></td></tr><tr><td valign="top" style="border-top:none; border-left:solid #DDDDDD 1.0pt; border-bottom:none; border-right:solid #DDDDDD 1.0pt; padding:0cm 0cm 0cm 0cm"><div align="center"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" id="templateBody" style="width:450.0pt; border-collapse:collapse"><tbody><tr><td valign="top" style="background:white; padding:0cm 0cm 0cm 0cm"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%; border-collapse:collapse"><tbody><tr><td valign="top" style="padding:12.0pt 12.0pt 12.0pt 12.0pt"><h1>Orderinformation för ALS Workorder ST2106255</h1><h3>Projekt: Ragn-Sells, Högbytorp</h3><p style="line-height:110%"><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif; color:#202020">Hej Gun-Britt Berglund, </span></p><p style="line-height:110%"><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif; color:#202020">Bifogade är följande filer för din beställning <b>ST2106255</b>:</span></p><ul type="disc"><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">ST2106255_0_COA_Standard_sv-SE.pdf</span><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">EDD_XLS_STD_ST2106255_0_sv-SE.xlsx</span><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">ST2106255_COC_202103181557.pdf</span><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">ST2106255_COC_202103231526.pdf</span><p class="MsoNormal" style="line-height:110%"><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif; color:#202020">&nbsp;</span></p><p style="line-height:110%"><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif; color:#202020">Rapportmottagare</span></p><ul type="disc"><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:7.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">Gun-Britt Berglund</span><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif"> </span><ul type="circle"><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:7.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">ST2106255_0_COA_Standard_sv-SE.pdf&nbsp;(Email)</span><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif"></span><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:7.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">EDD_XLS_STD_ST2106255_0_sv-SE.xlsx&nbsp;</span><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif"></span><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:7.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">ST2106255_COC_202103181557.pdf&nbsp;(Email)</span><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif"></span><li class="MsoNormal" style="color:#202020; line-height:110%"><span style="font-size:7.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif">ST2106255_COC_202103231526.pdf&nbsp;(Email)</span><span style="font-size:10.5pt; line-height:110%; font-family:&quot;Arial&quot;,sans-serif"></span></td></tr></tbody></table></td></tr></tbody></table></div></td></tr><tr><td valign="top" style="border:solid #DDDDDD 1.0pt; border-top:none; padding:0cm 0cm 0cm 0cm"><div align="center"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" id="templateFooter" style="width:450.0pt; background:white; border-collapse:collapse"><tbody><tr><td valign="top" style="padding:6.0pt 6.0pt 6.0pt 6.0pt"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%; border-collapse:collapse"><tbody><tr><td valign="top" style="padding:6.0pt 6.0pt 6.0pt 6.0pt"><p class="MsoNormal" align="center" style="text-align:center; line-height:125%"><span style="font-size:9.0pt; line-height:125%; font-family:&quot;Arial&quot;,sans-serif; color:#005387"><a href="https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.alsglobal.com%2F&amp;data=04%7C..." originalsrc="http://www.alsglobal.com/" shash="XjziGVU9jGlgay7rbgvE31uiYNEGiRzTsVPTLNkY1sYBjVGh2aUPUVt4f31Dg+eabrN2A9wdt2hqf0ZV0cwdJgKDFkrvxlXeezL8ISrh2oD3RleyuDDn6LBW4IZ9O2f/CCW7zUmUIWpV3jgPYqwuWcWvgAuuYoDGNlnYr1EkHE4="><span style="color:#005387">www.alsglobal.com</span></a></span></p></td></tr><tr><td valign="top" style="padding:6.0pt 6.0pt 6.0pt 6.0pt"><div class="MsoNormal" align="center" style="text-align:center; line-height:125%"><span style="font-size:9.0pt; line-height:125%; font-family:&quot;Arial&quot;,sans-serif; color:#005387"><hr size="5" width="100%" noshade="" align="center" style="color:#005387"></span></div><p class="MsoNormal" align="center" style="text-align:center; line-height:125%"><span style="font-size:10.0pt; line-height:125%; color:#005387">R&nbsp;I&nbsp;G&nbsp;H&nbsp;T&nbsp;&nbsp;&nbsp;S&nbsp;O&nbsp;L&nbsp;U&nbsp;T&nbsp;I&nbsp;O&nbsp;N&nbsp;S&nbsp;&nbsp;&nbsp;</span><span style="font-size:9.0pt; line-height:125%; font-family:&quot;Arial&quot;,sans-serif; color:#005387"> </span><b><span style="font-size:13.5pt; line-height:125%; color:#F8D744">|</span></b><span style="font-size:9.0pt; line-height:125%; font-family:&quot;Arial&quot;,sans-serif; color:#005387"> </span><span style="font-size:10.0pt; line-height:125%; color:#005387">&nbsp;&nbsp;&nbsp;R&nbsp;I&nbsp;G&nbsp;H&nbsp;T&nbsp;&nbsp;&nbsp;P&nbsp;A&nbsp;R&nbsp;T&nbsp;N&nbsp;E&nbsp;R</span><span style="font-size:9.0pt; line-height:125%; font-family:&quot;Arial&quot;,sans-serif; color:#005387"> </span></p></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table></div></td></tr></tbody></table></div><p class="MsoNormal">&nbsp;</p></div></div></body></html></p>

Paulie78
Super User III
Super User III

replace(
	replace(
		replace(
		  replace(
			  replace(
				replace(outputs('HTML'), '<ul>', '<br>'), 
				'</ul>', '<br>'
			  ),
			'<li>', '<br>'), 
		'</li>', '<br>'),
	'<ul type="circle">', ''),
'<li class="MsoNormal" style="color:#202020; line-height:110%">', '')

View solution in original post

Thank you again.  Awesome!

Hi, 

I get the same issue but I have a question, What should I put inside HTML? the body of the email? I am testing with the error I got.

SOL24_0-1618955866721.png

replace(
replace(
replace(
replace(outputs('TextBody'), '<ul>', ''),
'</ul>', ''
),
'<li>', ''),
'</li>', '')

 

SOL24_1-1618955904161.png

 

This is the error message of the original:

{"Message":"TypeError: nextPrefixCallback(...).trimStart is not a function\n at D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:218:32\n at Array.map (<anonymous>)\n at formatList (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:213:6)\n at formatUnorderedList (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:249:10)\n at recursiveWalk (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\html-to-text.js:267:9)\n at D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\helper.js:62:40\n at formatInline (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:24:3)\n at recursiveWalk (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\html-to-text.js:267:9)\n at D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\helper.js:62:40\n at formatList (D:\\home\\site\\wwwroot\\node_modules\\html-to-text\\lib\\formatter.js:233:5)"}

 

 

Thanks for your help! 

Can help me please

@SOL24 I cannot, because in order to test it, I need your HTML. Paste it on to pastebin.com and I will see if I can make it work.

MarioContreras
Advocate I
Advocate I

This is an error of the Content Conversion connector. Basically, the connector cannot handle nested lists (<ul> or <ol>).

 

I opened a support case and they mentioned there are just two support cases opened globally about this (mine is one of them). The product team now knows about the issue but it's a very but very low priority to fix this bug.

 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,118)