I am New to power automate and am running into some issues,
I have an email getting sent to a Email address and i am trying to only take from that email what i need.
The issue i am facing is that i have some fields that contain errors but they all have the same Delimitators, i will put an example bellow
This one was simple as the Start and finish are different but these names are not used in the HTML anyware elce.
OriginalMessageId>11123853</OriginalMessageId
But these are were i am having issues. what i would like it to show is bellow the 4 lines of HTML from the email
What the HTML is
<Issue type="2025">Payment 70066391 successfully uploaded from a file.</Issue>
<Issue type="2025">Payment 70066391 successfully uploaded from a file.</Issue>
<Issue type="104503">Payment successfully validated.</Issue>
<Issue type="181002">Payment has passed Account Validation.</Issue>
What i would like it to look like
70066391 successfully uploaded from a file.
70066391 successfully uploaded from a file.
Payment successfully validated.
Payment has passed Account Validation.
now in Power automate i can get one of these to work with the following config but cannot get it to do them all what am i missing
Initialize variable
Name = EmailStep12
last(split(Variables('EmailBody'),'<Issue type="'))
Initialize Variable
Name = EmailStep13Issue
first(split(variables('EmailStep12'),'</Issue>'))
Then Putting the Variable EmailStep13Issue into the Body of the email i send.
Now even if i copy this it only Duplicates the same error being Printed.
Any Help would be awsome.
Here is a copy of an email HTML,
I will put bellow what the fields that i am using already.
--> PaymentId
--> DateTime
-->OriginalFilename
--> UserMessage
now i need to be able to make the errors look nice and add them to my email but i can only seam to get one of the errors.
please let me know what you think. HTML bellow.
#####################################################################################
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoPlainText><PaymentsAcknowledgement type="info"><o:p></o:p></p><p class=MsoPlainText><PaymentId>11123858</PaymentId><o:p></o:p></p><p class=MsoPlainText><OriginalMessageId>11123853</OriginalMessageId><o:p></o:p></p><p class=MsoPlainText><DateTime>2021/04/20</DateTime><o:p></o:p></p><p class=MsoPlainText><CustomerId>testcustomer</CustomerId><o:p></o:p></p><p class=MsoPlainText><CompanyName>Test Company Name</CompanyName> <UserMessage>Payment status is PROCESSED</UserMessage> <DetailedMessage>Payment has been successfully processed.</DetailedMessage> <OriginalFilename>EFT2044486.ABA.asc</OriginalFilename><o:p></o:p></p><p class=MsoPlainText><Issues><o:p></o:p></p><p class=MsoPlainText>
<Issue type="290049">Uploaded Interchange 60063804 for Customer 382097 and Payment Type DL_DIRECTCREDIT.</Issue>
<Issue type="2025">Payment 70066391 successfully uploaded from a file.</Issue>
<Issue type="2025">Payment 70066391 successfully uploaded from a file.</Issue>
<Issue type="104503">Payment successfully validated.</Issue>
<Issue type="181002">Payment has passed Account Validation.</Issue>
<Issue type="6010">Payment is ready for authorisation - 1 authorisations required.</Issue>
<Issue type="6014">Payment has been fully authorised.</Issue>
<Issue type="181253">AVCDEF GHIJKLM [1111111111] has authorised the payment.</Issue>
<Issue type="130000">Available funds check passed.</Issue>
<Issue type="130001">Funds have been reserved.</Issue>
<Issue type="181301">Payment is ready to be submitted for processing.</Issue>
<Issue type="194500">Disbursement Report for Direct Link - Direct Credit Payment: 70066391 sent to mailbox .</Issue>
</Issues>
</PaymentsAcknowledgement><o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>The information contained in this email and its attachments may be confidential.<o:p></o:p></p><p class=MsoPlainText>If you have received this email in error, please notify the sender by return email, delete this email and destroy any copy.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Any advice contained in this email has been prepared without taking into account your objectives, financial situation or needs. Before acting on any advice in this email, National Australia Bank Limited (NAB) recommends that you consider whether it is appropriate for your circumstances.<o:p></o:p></p><p class=MsoPlainText>If this email contains reference to any financial products, NAB recommends you consider the Product Disclosure Statement (PDS) or other disclosure document available from NAB, before making any decisions regarding any products.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>If this email contains any promotional content that you do not wish to receive, please reply to the original sender and write "Don't email promotional material" in the subject.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>
@Anonymous please can you share a sample ?
@jinivthakkar
yes I did have a look at this but how can I select that data only out of an email that has more data in it ?
thanks
@Anonymous did you try the flow which I shared earlier, I showed you how it can be used, once you read received the data from email just pass it to html to text as I have shown.
The format will be the same with the starting and the ending of each error have the same HTML tag like I had at the start.
many ideas ?
@Anonymous if it is going to be so dynamic then its really difficult. You will have to establish some format in which you communicate with the earlier team which sends you email
The issue here is that these errors change,
so i am pulling them from an email that is being sent to me From another business and that they can change from Day to day with what the errors are, /
so it will need to be able to scan the email and pull out the errors.
@Anonymous this is what I tried, check if this helps.
Flow runs successfully
Output:
--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.