09-08-24 05:13 AM
Hi All ,
I have a use case where I need to copy a specific range from an Excel table and store it in a calculation stage, including in my email body. Could someone guide me on how to achieve this in Blue Prism?
Answered! Go to Answer.
a month ago
Hi @sandeshtope
Then bring 3 data items of type text html_body html_middle and html_end
Your flow should look like this :
in html_body put this :
<html>
<style>
table {
border-collapse: collapse;
}
th, td {
border: 1px solid black;
}
</style>
<body>
<p>Hi teams,</p>
<p>Please find the below table FYR.</p><br>
<table style="width:100%">
<tr><th>NAME</th><th>PRENAME</th><th>CONTRACT</th></tr>
In html_middle put this :
<tr><td>***NAME***</td><td>***PRENAME***</td><td>***CONTRACT***</td></tr>
in html_end put this :
</table>
<p>Regards.</p>
<p>Blue Prism</p>
</body>
</html>
in Set_mail_body calculation stage put this :
[html_body]&Replace(Replace(Replace([html_middle],"***NAME***",[Data.Name])
,"***PRENAME***",[Data.Prename])
,"***CONTRACT***",[Data.Contract])
like this :
in Close mail calculation stage put this :
[html_body]&[html_end]
like this :
in send mail put this :
when you send the mail you will receive this :
PS : if you want to extract a part of your data in the excel sheet you can use this action :
otherwise you can use filter or decision stage 🙂
please tell me if everything is good for you
09-08-24 09:50 AM - edited 09-08-24 09:53 AM
Hi @sandeshtope
I can help you but we will opt for another approach. What I propose is to retrieve the range of the Excel file then we make a loop to build the body of your email. Could you tell me if this suits you? If yes could you put more details on the file?
09-08-24 10:01 AM
You can also consider using an Excel Macro as an alternative method. It can effectively fulfill the requirements you've outlined in your post.
10-08-24 12:23 PM
Sorry I thought I posted the answer yesterday but looking again I didn't see the answer published (bad connection)
Let's suppose we have this excel file
Let's suppose I want to put my contracts in an email
1. Bring a data item of type text and call it html_single_row , set its value to :
<p>***CONTRACT***</p>
2. Bring a data item of type text and call it Mail Body , set its value to :
<style>
table {font-family: Verdana; font-size: 10pt; width: 100%}
td {border: 1px solid gray; border-collapse: collapse; padding: 5px}
</style>
<div style="font-family: Verdana; font-size: 10pt">
<p>Hello, </p>
<p>Please find below your contracts. </p></br>
***FILESSUCCESS***
<p>Regards</p>
<p>Blue Prism Robot</p>
<p><i>***Please dont reply to this automatic message***</i></p>
</div>
3.Open your excel file via MS EXCEL VBO and bring your data like this :
4. Make a loop on your wanted column. In my cas it's Contract
your flow should look like this :
in Set Contracts put this :
[Contracts]&Replace([html_single_row],"***CONTRACT***",[Data.Contract])
see below the screen shot
Final step bring Ms Outlook Email VBO
and put this
Replace([Mail Body],"***FILESSUCCESS***",[Contracts])
you will receive this mail at the end
Regards
a month ago
Thanks @Mohamad_747 for your answer but below is my requirement
Lets consider My input excel looks like this :
And The message body I am looking for looks like this :
Hi Team ,
Please find the below table FYR
NAME | PRENAME | CONTRACT |
A | Q | abcd |
B | W | efgh |
C | E | hijk |
D | R | lmno |
Regards,
Blue Prism Robot
Please don't reply to this automatic message
a month ago
Hi @sandeshtope
Then bring 3 data items of type text html_body html_middle and html_end
Your flow should look like this :
in html_body put this :
<html>
<style>
table {
border-collapse: collapse;
}
th, td {
border: 1px solid black;
}
</style>
<body>
<p>Hi teams,</p>
<p>Please find the below table FYR.</p><br>
<table style="width:100%">
<tr><th>NAME</th><th>PRENAME</th><th>CONTRACT</th></tr>
In html_middle put this :
<tr><td>***NAME***</td><td>***PRENAME***</td><td>***CONTRACT***</td></tr>
in html_end put this :
</table>
<p>Regards.</p>
<p>Blue Prism</p>
</body>
</html>
in Set_mail_body calculation stage put this :
[html_body]&Replace(Replace(Replace([html_middle],"***NAME***",[Data.Name])
,"***PRENAME***",[Data.Prename])
,"***CONTRACT***",[Data.Contract])
like this :
in Close mail calculation stage put this :
[html_body]&[html_end]
like this :
in send mail put this :
when you send the mail you will receive this :
PS : if you want to extract a part of your data in the excel sheet you can use this action :
otherwise you can use filter or decision stage 🙂
please tell me if everything is good for you
3 weeks ago
Hi @sandeshtope
Any update ?