Help. I'm new to UI Path. Please clear mydoubt

So i have written some data into a .csv file and suppose it has 3 row content in it. (Table provided in screenshot).

I need that data in the mail body in the following format (provided in screenshot) :

Hello,

The top 3 results for TV are

Name
First Product name

Price
First product price

Discount
First product discount

Name
Second Product name

Price
Second Product price

… Till 3rd product.

Hi @Athul_Krishnan ,

We can do this by replacing the placeholder in the mail body.

  1. First we need to read the CSV file using Read CSV activity, which will output a datatable (DT)
  2. Create a string variable

template = "Name
FirstProductName

Price
FirstProductPrice

Discount
FirstProductDiscount"

  1. create new variable

mailBody = "Hello,

The top 3 results for TV are,"

  1. Then iterate on the datatable,

For each Row in DT
mailBody = mailBody+template;
mailBody = mailBody.Replace(“FirstProductName”,Row(0).tostring).Replace(“FirstProductPrice”,Row(1).tostring).Replace(“FirstProductDiscount”,Row(2).tostring);

Thankyou very much

1 Like