Forum Discussion

Gilbert Okello's avatar
Gilbert Okello
Iron Contributor
May 09, 2017

How to remove html characters when copying Email content to SharePoint List

I have a flow which copies Email content (Body) into a SharePoint list field (multiple lines text).

The content gets copied with html tags. 

How can i remove the html tags?

 

The content below was a simple "Test 6" in the email body which then was copied with all  the additional markup into the SharePoint list.

 

------ Example ---------- 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="text/html; charset=us-ascii">
<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;
    margin-bottom:.0001pt;
    font-size:11.0pt;
    font-family:"Calibri",sans-serif}
a:link, span.MsoHyperlink
    {color:#0563C1;
    text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
    {color:#954F72;
    text-decoration:underline}
span.EmailStyle17
    {font-family:"Calibri",sans-serif;
    color:windowtext}
.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">
<div class="WordSection1">
<p class="MsoNormal">Test 6</p>
</div>
</body>
</html>

----- Example ----

 

 

 

Jon LevesqueMikael Svenson

11 Replies

  • One approach is to create a custom flow action which parses the HTML for you in order to grab the text. Or store the full e-mail as a .msg file in a doc lib - as SPO now has online viewer for msg files.
    • Gavinash Sirisena's avatar
      Gavinash Sirisena
      Copper Contributor

      Hello, sorry I'm just jumping in here because of your mention of the viewer for .msg files. How do we enable/access this?

      • Mikael Svenson's avatar
        Mikael Svenson
        Iron Contributor
        Hi,
        the fact that I don't know how to save an email from a Flow to a lib as msg is one thing.. but if you put a .msg file in a modern library and click it, it will render in the browser.
      • Juliana Mate's avatar
        Juliana Mate
        Copper Contributor

        I am trying to do a similar thing with the body of an email, but I'm not sure if the same settings for email, not Sharepoint. I don't see a Enhanced Rich Text option, but I'm new to flow, so not sure if I just don't know where to look. See screenshot for the problematic body text. 

         

        Body: <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta content="text/html; charset=us-ascii">
        </head>
        <body>
         
         
        text
         
        </body>
        </html>
  • Hello,
    Does setting the multiple lines of text field to "plain text" in SharePoint help?

Resources