Create Text from Excel info

Hello all,
New UiPath user and need a little help.

image

I would like read the excel file above and create a text ( to be used in an email) with the following format.


Hello {Name}

Your meeting time is at {Time}

Thank you


and then send it to {Email Address}

Any help would be greatly appreciated!

hi @jack-keenan-clancy, please try attached xaml for prearing the mail body content.Test excel.xaml (6.6 KB)

this is html body content , you must check the isBodyHtml, PFB screen shot

New Microsoft Excel Worksheet.xlsx (8.3 KB)

Hi @jack-keenan-clancy welcome to forum

For this

  1. First create a text file with following text

Hello Name

Your meeting time is at Time

Thank you

  1. Read the excel field and store in dt1

  2. Use for each row to loop through each rows of dt1

Inside it use the following

  1. Read the text file and store in stringvariable body

use Assign activitiy to assign body varible with values of each rows from excel

body = body.Replace(“Name”, row(0).ToString). Replace (“Time”, row(1).ToString)

Then after this use mail activity like Outlook mail message activitiy or smtp to send an email with email to whom u want to.send as row(2).ToString

Hope it helps you

Regards

Nived N

Happy Automation :slight_smile::slight_smile::slight_smile:

1 Like

Works perfectly! Thank you so much! :smiley: :smiley: :smiley:

However, the [Time] is coming out as 12/30/1899 09:00:00 because of the excel format.

I tried to use substring to trim only (09:00), but was unable to because the [Time] isn’t a string in the first place. (also tried to change [Time] to string, but that didn’t work either)

If you have the time, do you have any ideas?

Thanks in advance!

Hi,

for you time issue instead of row(1).tostring use something like

body = body.Replace(“Name”, row(0).ToString). Replace (“Time”, Cdate(row(1).ToString).toString("dd/MM/yyyy"))

cheers

Hi @jack-keenan-clancy

Check @Shikhar_Tandon post he had explained that part

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.