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

Removing Forwarders information

Hi There, I have a flow that processes a table forwarded to me by email from several sources, this works the majority of the time however on some occasions information included by the by the person forwarding the email to me such as Signatures and the such like interfere with the flow. So My question: Is there a way to ignore all information but that in the original email body, effectively a way to strip all the forwarders additions out of the body.

 

Thank you for taking the time to read this. if you need any more information then please let me know as i've tried on my own and i just cannot work out how to do it.

1 ACCEPTED SOLUTION

Accepted Solutions
Rhiassuring
Super User
Super User

Hi there, 

 

I've run the email you've forwarded me through it, and with a few tweaks, it does the trick. 


Rhiassuring_0-1650095364039.png

 

 

Of course this doesn't JUST get you the table - but you've now got the appropriate chunk without all the encoding since the wording should be pretty standard. It also means we don't need to worry about other tables that might've been somewhere in the forward string.

 

You could now grab everything between <table and </table> pretty confidently.  Find text position of both, and just like before, sub the prior from the latter. 

Cheers,

Rhia

 

 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



View solution in original post

10 REPLIES 10
Rhiassuring
Super User
Super User

Hi there, 

 

You mention that they forward a table - is this a pasted table in the email body itself, and not an attachment? Is there any standard "ending" to these emails that are sent?  In emails sent, a lot of times there will be a big --------- between the most recent response and all else. If this is the case with your email, we could tell Power Automate to yeet everything after & including that big hyphen line. 

Curious to hear more about your email / table specifics.

 

Cheers,

 

Rhia

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Hi Rhiassuring. 

The code below is an example of the original emails i get.

 

<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}
    @font-face
        {font-family:Cambria}
    @font-face
        {font-family:Tahoma}
    p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
    span.EmailStyle20
        {font-family:"Calibri",sans-serif;
        color:windowtext}
    .MsoChpDefault
        {font-size:10.0pt}
    @page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
    div.WordSection1
        {}
    -->
    </style>
    </head>
    
    <body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word">
        <div class="WordSection1">
            <p class="MsoNormal"><span style="">&nbsp;</span></p>
            <p class="MsoNormal"><span style="">&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 lang="EN-US">From:</span></b><span lang="EN-US"> Rick
                            &lt;rick@anyjobltd.org&gt; <br><b>Sent:</b> 25 March 2022 02:14<br><b>To:</b>
                            'thebigjob@allbigjobs.com'
                            &lt;thebigjob@allbigjobs.com&gt;<br><b>Subject:</b> Work Order Status</span></p>
                </div>
            </div>
            <p class="MsoNormal">&nbsp;</p>
            <div>
                <div id="x_divRplyFwdMsg">
                    <div>
                        <p class="MsoNormal">&nbsp;</p>
                    </div>
                </div>
                <div>
                    <p><span lang="EN-US">Please find enclosed below detail of your recently raised call:- </span></p>
                    <p><span lang="EN-US">WO# R2012051 Work Order Created</span></p>
                    <p><span lang="EN-US">&nbsp;</span></p>
                    <table class="MsoNormalTable" border="1" cellpadding="0" width="601" style="width:450.75pt">
                        <tbody>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><a name="x_x__Hlk3181679"><b><span style="font-family:&quot;Cambria&quot;,serif">Reference
                                                    Number:</span></b></a></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">R2012051</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Reported Date:</span></b></p>
                                </td>
                                <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Feb 23 2022 3:58PM</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Reporter Name:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Mr Right</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Priority:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">P4</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Estimated
                                                Completion:</span></b></p>
                                </td>
                                <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Mar 23 2022 3:58PM</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Actual&nbsp;Completion:</span></b>
                                    </p>
                                </td>
                                <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">N/A</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Building:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Any Building</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Location:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">VARI </span></p>
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">VARIOUS AREAS</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Problem:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Grounds Maintenance (Shrub
                                            Clearance / Litter Picking / Weeding etc):&gt;BN0039A1the grass outside needs
                                            trimming </span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Detail:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt"></td>
                            </tr>
                        </tbody>
                    </table>
                    <p>&nbsp; </p>
                    <p><span style="font-family:&quot;Times New Roman&quot;,serif">If you require any additional
                            information, please call Someone else or email on: </span></p>
                    <p>&nbsp;</p>
                    <p style="margin-bottom:8.0pt; line-height:105%"><span style="font-family:&quot;Tahoma&quot;,sans-serif">Anyjob<span style="color:#435254"> Limited,
                                Registered Office: </span>Your<span style="color:#435254"> House, </span>My<span style="color:#435254"> Place, London, W1</span>A<span style="color:#435254"> </span>2G<span style="color:#435254">B, registered in England and Wales No. </span>6561248<span style="color:#435254">.Regulated by the </span>myself<span style="color:#435254">.<br>&nbsp;<br>This communication is from </span>Anyjob<span style="color:#435254"> Limited or one of its associated/subsidiary
                                companies.<br>&nbsp;<br>This communication contains information which is confidential and
                                may be privileged. If you are not the intended recipient, please contact the sender
                                immediately.<br>&nbsp;<br></span>Remember who you send this too<span style="color:#435254">,
                            </span>may not send it on<span style="color:#435254">, </span>so dont<span style="color:#435254"> rely on its contents in any way whatsoever.<br>&nbsp;<br>Reasonable
                                care has been taken to ensure that this communication (and any attachments or hyperlinks
                                contained within it) is free from computer viruses.<br>No responsibility is accepted by
                            </span>Anyjob<span style="color:#435254"> Limited or its associated/subsidiary companies and the
                                recipient should carry out any appropriate virus checks.<br>&nbsp;<br>Details about the
                                personal data </span>Anyjob<span style="color:#435254"> Limited collects and why, as well as
                                your data privacy rights under applicable law, are available&nbsp;</span><span style="color:#003F2D">at&nbsp;</span></span>the&nbsp; Back door</p>
                </div>
            </div>
        </div>
        <div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br><br>
            <hr style="border:none; color:#909090; background-color:#B0B0B0; height:1px; width:99%">
            <table style="border-collapse:collapse; border:none">
                <tbody>
                    <tr>
                        <td style="border:none; padding:0px 15px 0px 8px"><a href="https://www.avast.com/antivirus"><img border="0" src="./output 1-1_files/avast-mail-stamp.png" alt="Avast logo">
                            </a></td>
                        <td>
                            <p style="color:#3d4d5a; font-family:&quot;Calibri&quot;,&quot;Verdana&quot;,&quot;Arial&quot;,&quot;Helvetica&quot;; font-size:12pt">
                                This email has been checked for viruses by Avast antivirus software. <br><a href="https://www.avast.com/antivirus">www.avast.com</a> </p>
                        </td>
                    </tr>
                </tbody>
            </table><br><a href="file:///C:/Users/rixxc/Desktop/output%201-1.html#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a>
        </div>
    
    
    </body></html>

 A Screenshot of the Above code. My Flow processes this fine when its sent directly from source However when this same email is forwarded rather than me getting it directly the forwarders information with possible other tables used for Signatures messes it all up. Hope that helps 

screen.png

Rhiassuring
Super User
Super User

Hi there, 

I copied your  code above into a variable, and tested it out with using a substring. I was able to get the table out following this pattern:

Rhiassuring_1-1650046283776.png

 

 

The formula on the last Compose is:  

 

substring(variables('txtHTML'), outputs('Find_text_position_-_TableStart)?['body'], sub(outputs('Find_text_position_-_TableEnd')?['body'],outputs('Find_text_position_-_TableStart')?['body']))
 
Basically, it's just saying "find everything in the HTML from the starting position of where we found the "TableStart" data, then, subtract TableEnd position from TableStart position to tell us the length (number of characters) we need to return."
 

Of course, it'd have to be the same every time. I used your "If you require any additional" as a way to grab the end, but you could use specific table ending data.

Running this flow, I get this returned:

 

 <table class="MsoNormalTable" border="1" cellpadding="0" width="601" style="width:450.75pt">
                        <tbody>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><a name="x_x__Hlk3181679"><b><span style="font-family:&quot;Cambria&quot;,serif">Reference
                                                    Number:</span></b></a></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">R2012051</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Reported Date:</span></b></p>
                                </td>
                                <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Feb 23 2022 3:58PM</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Reporter Name:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Mr Right</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Priority:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">P4</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Estimated
                                                Completion:</span></b></p>
                                </td>
                                <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Mar 23 2022 3:58PM</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Actual&nbsp;Completion:</span></b>
                                    </p>
                                </td>
                                <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">N/A</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Building:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Any Building</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Location:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">VARI </span></p>
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">VARIOUS AREAS</span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Problem:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><span style="font-family:&quot;Cambria&quot;,serif">Grounds Maintenance (Shrub
                                            Clearance / Litter Picking / Weeding etc):&gt;BN0039A1the grass outside needs
                                            trimming </span></p>
                                </td>
                            </tr>
                            <tr>
                                <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                    <p><b><span style="font-family:&quot;Cambria&quot;,serif">Detail:</span></b></p>
                                </td>
                                <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt"></td>
                            </tr>
                        </tbody>
                    </table>
                    <p>&nbsp; </p>
                    <p><span style="font-family:&quot;Times New Roman&quot;,serif">


Does this help?

 

Cheers,

 

Rhia

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Hi Thanks for the reply, the code i pasted is actually code that my flow processes correctly, i have knocked together another example that may demonstrate the problem as it is forwarded to my with a signature from the forwarder. 

 

 

<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta content="Microsoft Word 15 (filtered medium)"><style>
    <!--
    @font-face
        {font-family:"Cambria Math"}
    @font-face
        {font-family:Calibri}
    @font-face
        {font-family:Cambria}
    @font-face
        {font-family:Tahoma}
    p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
    a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
    p.xmsonormal, li.xmsonormal, div.xmsonormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
    .MsoChpDefault
        {font-size:10.0pt}
    @page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
    div.WordSection1
        {}
    -->
    </style>
    </head>
    
    <body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word">
        <div class="WordSection1">
            <p class="MsoNormal">&nbsp;</p>
            <div id="divRplyFwdMsg">
                <p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Rick &lt;<a
                            href="mailto:Rick@anyjob.com">Rick@anyjob.com</a>&gt;<br><b>Sent:</b> 15 April 2022
                        20:19<br><b>To:</b> Rick Cobern &lt;<a
                            href="mailto:Rick@anyjob.com">Rick@anyjob.com</a>&gt;<br><b>Subject:</b>
                        FW: Work Order Status</span> </p>
                <div>
                    <p class="MsoNormal">&nbsp;</p>
                </div>
            </div>
            <div>
                <div>
                    <p class="xmsonormal">Just a demo with some fictional signature details.</p>
                    <p class="xmsonormal">&nbsp;</p>
                    <p class="xmsonormal">&nbsp;</p>
                    <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"
                        style="border-collapse:collapse">
                        <tbody>
                            <tr>
                                <td width="113"
                                    style="width:84.8pt; border:none; border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt">
                                    <p class="xmsonormal"><a href="http://www.cwusec.org.uk/"><span
                                                style="font-size:10.0pt; text-decoration:none"><img border="0" width="184"
                                                    height="88" id="x_Picture_x0020_1"
                                                    src="cid:image005.jpg@01D85106.2377B150"
                                                    style="width:1.9166in; height:.9166in"></span></a></p>
                                </td>
                                <td width="246"
                                    style="width:184.3pt; border:none; border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt">
                                    <p class="xmsonormal"><b><span style="font-size:12.0pt; color:#D70066">Rick </span></b>
                                    </p>
                                    <p class="xmsonormal" style="margin-bottom:12.0pt"><span
                                            style="font-size:12.0pt; color:#333333">Co-ordinator</span></p>
                                    <p class="xmsonormal"><span style="font-size:12.0pt; color:#333333">M: 07444 922126 O:
                                            01956 744444</span></p>
                                    <p class="xmsonormal"><span style="font-size:12.0pt; color:#333333">&nbsp;</span></p>
                                    <p class="xmsonormal"><span style="color:#0070C0"><a
                                                href="mailto:rick@nowherereal.com">rick@nowherereal.com</a></span></p>
                                    <p class="xmsonormal"><span style="color:#0070C0">&nbsp;</span></p>
                                    <p class="xmsonormal"><span style="color:#333333">&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
                                </td>
                                <td width="208" style="width:155.9pt; padding:0cm 5.4pt 0cm 5.4pt">
                                    <p class="xmsonormal"><a href="https://www.cwu.org/" title="https://www.cwu.org/"><span
                                                style="color:windowtext; text-decoration:none"><img border="0" width="199"
                                                    height="95" id="x_Picture_x0020_2"
                                                    src="cid:image006.jpg@01D85106.2377B150"
                                                    style="width:2.0729in; height:.9895in"></span></a></p>
                                </td>
                                <td width="113" style="width:3.0cm; padding:0cm 5.4pt 0cm 5.4pt"></td>
                            </tr>
                        </tbody>
                    </table>
                    <p class="xmsonormal">&nbsp;</p>
                    <p class="xmsonormal">&nbsp;</p>
                    <p class="xmsonormal">&nbsp;</p>
                    <p class="xmsonormal">&nbsp;</p>
                    <div>
                        <div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
                            <p class="xmsonormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Rick &lt;<a
                                        href="mailto:rick@nowherereal.com">rick@nowherereal.com</a>&gt; <br><b>Sent:</b> 30
                                    March 2022 12:16<br><b>To:</b> 'Flowtests@Nowherereal.com' <br><b>Subject:</b> Work
                                    Order Status</span></p>
                        </div>
                    </div>
                    <p class="xmsonormal">&nbsp;</p>
                    <div>
                        <div>
                            <p class="xmsonormal">&nbsp;<span lang="EN-US">Please find enclosed below detail of your
                                    recently raised call:- </span></p>
                            <p><span lang="EN-US">WO# R2012051 Work Order Created</span></p>
                            <p><span lang="EN-US">&nbsp;</span></p>
                            <table class="MsoNormalTable" border="1" cellpadding="0" width="601" style="width:450.75pt">
                                <tbody>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><a name="x_x_x__Hlk3181679"><b><span
                                                            style="font-family:&quot;Cambria&quot;,serif">Reference
                                                            Number:</span></b></a></p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">R2012051</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Reported
                                                        Date:</span></b></p>
                                        </td>
                                        <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Feb 23 2022 3:58PM</span>
                                            </p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Reporter
                                                        Name:</span></b></p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Mr Right</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Priority:</span></b>
                                            </p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">P4</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Estimated
                                                        Completion:</span></b></p>
                                        </td>
                                        <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Mar 23 2022 3:58PM</span>
                                            </p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span
                                                        style="font-family:&quot;Cambria&quot;,serif">Actual&nbsp;Completion:</span></b>
                                            </p>
                                        </td>
                                        <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">N/A</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Building:</span></b>
                                            </p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Any Building</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Location:</span></b>
                                            </p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">VARI </span></p>
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">VARIOUS AREAS</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Problem:</span></b>
                                            </p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Grounds Maintenance
                                                    (Shrub Clearance / Litter Picking / Weeding etc):&gt;BN0039A1the grass
                                                    outside needs trimming </span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Detail:</span></b></p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p class="xmsonormal">No Detail</p>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <p>&nbsp; </p>
                            <p><span style="font-family:&quot;Times New Roman&quot;,serif">If you require any additional
                                    information, please call Someone else or email on: </span></p>
                            <p>&nbsp;</p>
                            <p style="margin-bottom:8.0pt; line-height:105%"><span
                                    style="font-family:&quot;Tahoma&quot;,sans-serif">Anyjob<span style="color:#435254">
                                        Limited, Registered Office: </span>Your<span style="color:#435254"> House,
                                    </span>My<span style="color:#435254"> Place, London, W1</span>A<span
                                        style="color:#435254"> </span>2G<span style="color:#435254">B, registered in England
                                        and Wales No. </span>6561248<span style="color:#435254">.Regulated by the
                                    </span>myself<span style="color:#435254">.<br>&nbsp;<br>This communication is from
                                    </span>Anyjob<span style="color:#435254"> Limited or one of its associated/subsidiary
                                        companies.<br>&nbsp;<br>This communication contains information which is
                                        confidential and may be privileged. If you are not the intended recipient, please
                                        contact the sender immediately.<br>&nbsp;<br></span>Remember who you send this
                                    too<span style="color:#435254">, </span>may not send it on<span style="color:#435254">,
                                    </span>so dont<span style="color:#435254"> rely on its contents in any way
                                        whatsoever.<br>&nbsp;<br>Reasonable care has been taken to ensure that this
                                        communication (and any attachments or hyperlinks contained within it) is free from
                                        computer viruses.<br>No responsibility is accepted by </span>Anyjob<span
                                        style="color:#435254"> Limited or its associated/subsidiary companies and the
                                        recipient should carry out any appropriate virus checks.<br>&nbsp;<br>Details about
                                        the personal data </span>Anyjob<span style="color:#435254"> Limited collects and
                                        why, as well as your data privacy rights under applicable law, are
                                        available&nbsp;</span><span style="color:#003F2D">at&nbsp;</span></span>the&nbsp;
                                Back door</p>
                        </div>
                    </div>
                </div>
                <div id="x_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2">
                    <p class="MsoNormal" style="margin-bottom:12.0pt">&nbsp;</p>
                    <div class="MsoNormal" align="center" style="text-align:center">
                        <hr size="1" width="99%" noshade="" align="center" style="color:#909090">
                    </div>
                    <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"
                        style="border-collapse:collapse">
                        <tbody>
                            <tr>
                                <td style="padding:0cm 11.25pt 0cm 6.0pt">
                                    <p class="MsoNormal"><a href="https://www.avast.com/antivirus"><span
                                                style="text-decoration:none"><img border="0" width="90" height="33"
                                                    id="_x0000_i1029"
                                                    src="http://static.avast.com/emails/avast-mail-stamp.png"
                                                    alt="Avast logo" style="width:.9375in; height:.3437in"></span></a></p>
                                </td>
                                <td style="padding:.75pt .75pt .75pt .75pt">
                                    <p><span style="font-size:12.0pt; color:#3D4D5A">This email has been checked for viruses
                                            by Avast antivirus software. <br><a
                                                href="https://www.avast.com/antivirus">www.avast.com</a> </span></p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <p class="MsoNormal"><br><br></p>
                </div>
            </div>
        </div>
    </body>
    
    </html>

I have just sent you the body. Thanks 

Rhiassuring
Super User
Super User

Hi there, 


I dropped that into my txtHTML example and it seems to have worked as well. This is the output:

 <table class="MsoNormalTable" border="1" cellpadding="0" width="601" style="width:450.75pt">
                                <tbody>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><a name="x_x_x__Hlk3181679"><b><span
                                                            style="font-family:&quot;Cambria&quot;,serif">Reference
                                                            Number:</span></b></a></p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">R2012051</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Reported
                                                        Date:</span></b></p>
                                        </td>
                                        <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Feb 23 2022 3:58PM</span>
                                            </p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Reporter
                                                        Name:</span></b></p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Mr Right</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Priority:</span></b>
                                            </p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">P4</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Estimated
                                                        Completion:</span></b></p>
                                        </td>
                                        <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Mar 23 2022 3:58PM</span>
                                            </p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span
                                                        style="font-family:&quot;Cambria&quot;,serif">Actual&nbsp;Completion:</span></b>
                                            </p>
                                        </td>
                                        <td style="padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">N/A</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Building:</span></b>
                                            </p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Any Building</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Location:</span></b>
                                            </p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">VARI </span></p>
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">VARIOUS AREAS</span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Problem:</span></b>
                                            </p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><span style="font-family:&quot;Cambria&quot;,serif">Grounds Maintenance
                                                    (Shrub Clearance / Litter Picking / Weeding etc):&gt;BN0039A1the grass
                                                    outside needs trimming </span></p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="42%" style="width:42.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p><b><span style="font-family:&quot;Cambria&quot;,serif">Detail:</span></b></p>
                                        </td>
                                        <td width="58%" style="width:58.0%; padding:5.25pt 5.25pt 5.25pt 5.25pt">
                                            <p class="xmsonormal">No Detail</p>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <p>&nbsp; </p>
                            <p><span style="font-family:&quot;Times New Roman&quot;,serif">

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Ok Rhia I must be doing something wrong, Im new to all this so please be patient with me. Can you expand your flow so i can see where im going wrong, although i am trying from When email arrives rather than using the HTML but that shouldn't make a difference. If you don't mind i will copy your code and make a fresh Flow.

 

Kind Regards

Rick

Rhiassuring
Super User
Super User

No problem at all @DoctaShed - 

Rhiassuring_0-1650064580823.png

It'll be hard for me to replicate the incoming email from the direct source, unless you want to shoot one over to me for me to try out. If you're comfortable with that, let me know, and I'll give you my email address.

Cheers,

Rhia

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



@Rhiassuring  its more about if you are comfortable than me, i'm the one who needs the help. but i would be happy to send you an email with the example, who new it would be so complicated to get a table from an email into a spreadsheet...LOL huge learning curve for me.. 

 

 

I Must have done something wrong  because your flow output is exactly what i want but i cant get it to work. can you see anything i've done wrong..

flow code output.pngflow code.png

Exact Expression I used.

substring(variables('txtHTML'), outputs('Find_text_position_-_TableStart')?['body']?['body'], sub(outputs('Find_text_position_-_TableEnd')?['body']?['body'], outputs('Find_text_position_-_TableStart')?['body']?['body']))
Rhiassuring
Super User
Super User

Hi there, 

 

I've run the email you've forwarded me through it, and with a few tweaks, it does the trick. 


Rhiassuring_0-1650095364039.png

 

 

Of course this doesn't JUST get you the table - but you've now got the appropriate chunk without all the encoding since the wording should be pretty standard. It also means we don't need to worry about other tables that might've been somewhere in the forward string.

 

You could now grab everything between <table and </table> pretty confidently.  Find text position of both, and just like before, sub the prior from the latter. 

Cheers,

Rhia

 

 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



@Rhiassuring   You made it look so Easy, Thank you so much, that gives me something I can use in my flow to stop the headaches.

 

Again thank you so much.

 

Rick

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (4,317)