Sending one email according to three rows and three columns in DataTable

hello,
how can I Send one email according to three rows and three columns from DataTable variable?

Hello @Lior_Ben_Naim

Please explain in detail

hey,

i have a Data Table:
|Name |Last Name|DOB|
|Roni|Bird|1985|
|Emily|Rose|1990|
|Jeff|Harding|1980|

I want to send one email message with all of this data like:
“Dear” + ‘Name1’ + ‘Last Name1’ + ‘DOB1’
“Dear” + 'Name2 + ‘Last Name2’ + ‘DOB2’
“Dear” + ‘Name3’ + ‘Last Name3’ + ‘DOB3’

How can i do this?

@Lior_Ben_Naim Do you want to send only one mail or you want to repeat the activity for the rest of the rows also i.e., taking three rows at a time and sending a mail?

i want to write it all in one email

@Lior_Ben_Naim

Let the data table variable be inputDT
Use assign activity
On the Left side use a new a variable say MailString of type String
On the right side use the code below

String.Join(Environment.NewLine, inputDT.AsEnumerable.Select(Function (x) String.Join(" ", {"Dear", x(0).ToString, x(1).ToString, x(2).ToString})))

you will get the required string stored in the String variable MailString. You can use this string variable in mail Body

but i need to do this to all the rows not just one

It is for all rows. Try it

image

Thank you very much :slight_smile:

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