How to email using outlook and append body with table of content

Hi,

How could I read say, 3 columns from excel
and email using outlook with`

(i) The 3 columns appended as a table;
(ii) Also, hyperlink text in the body;

Example here for clarity

Thanks !

@Learning

you need to use html tags to implement this.

Thanks @rahatadi. I have not used html coding. Do you have a sample to read from excel and email outlook body with html tag to formulate the table of the variables from excel ?

@learning - you can perform step of action on excel worksheet, create new email and paste table copied from excel range into email body.

@Learning

sample code.html (487 Bytes)

you can modify with respect to input table data

Thanks @rahatadi. Do you mean append the following codes in to the body ofsend outlook email activity ? If yes, how do I put in the variable from excel into the html. For example if I assign var1 for columnE of excel, the how to I put var1 into the html codes. Thannks.

table, th, td { border: 1px solid black; }
Movie title No of tickets location
movie name1 ticket number1 location1
movie name2 ticket number2 location2
link can be present as any title

Thanks @NiteenM. I am new to UIPath. Pls share where I could read on excel step of action. I am not able to find in google for such a topic.

I am not able to upload sample mark up file.

@Learning

please check following

code1.html (204 Bytes)
HTMLData.xaml (8.2 KB)

Does it work for you?

2 Likes

Thanks @rahatadi.

There is an error as appended.

Also, I do not see any assignment of variable from reading the excel columns into the email body.

Could you provide a simple program that read the exel, write the columns into the send outlook activity as a table. Thanks.

Hi @Learning

It seems like your datatable dont have column movie.
It wont need any assignment of variables.
Are you able to run code with the sample xlsx provided?

Could you please upload your input excel file?
I have updated the comment at last. That is your required output.

Hi @rahatadi,

i run the program with the input and got a message box for your reference.

output_expected.xlsx (9.1 KB)

Thanks

@Learning

Use this text output in your body of mail.

Thank @rahatadi. I got it.

Also, this may not be related. But I thot I just ask since you may be familar with html. I tried to append spaces to increase the width of the column label, say

“Movie title ”

Capture4

But the column width still end at the last character in “Movie title”. Anyway, I could increase the width to make it more presentable? Thanks !

Hello @Learning

 
add this tag where you want extra space

regards,
Aditya

please close topic by marking most useful reply as solution :slight_smile:

That’s good. I will look into the tag. Thanks @rahatadi again.

@Learning

always welcome.

Hi @rahatadi,

Please help me on the change in requirement.

I have added the send outlook activity to send email.

However, now I want to send email per row in excel. As I look thru the program, I figure append wlill add the next row to the table of content which is meant for the next person.

I fiigure I need to intitialise the append after the first row is processed. So that the code1.html is always capturing content of the current row.

Also, can you help me put in a line in the body for hyperlink text for my sample. I have also attached the sample output.

Thanks.

HTMLData.xaml (9.0 KB)
output_expected.xlsx (9.3 KB)

1 Like

@Learning

HTMLData.xaml (9.3 KB)

regards,
Aditya

1 Like

Thanks @rahatadi for the super fast response.

I try to compare the codes. The trick is put in the sequence so that every row is processed befoore it goes to read next row ? So there is no concept of intiilise what is appended I suppose ?

Also, can help me put in a text with hyperlink in the email body at the end so that I know how to figure out. Thanks

Eg. Last para - You could check your movie preview at “http://youtube.com