How to get entire column data and attach it in a Single mail body

I want to read excel and get all data from entire column and add it in a mail body.
Suppose in Names column there are 5 rows and i want to add all that 5 rows in the mail body.
Please help.

1 Like

Hi @Kgk
Welcome to the community!!!

For doing this you will need to do for each in data row, and then pick the values and store it in a string and append it as per the value!!!

Hope this helps, in case of query do let me know!!!

Cheers :slight_smile:

@Kgk

Welcome to the uipath community.

Try this:

       newDT = DT.DefaultView.ToTable(False, "ColumnName").CopyToDataTable

And then use Output Datatableactivity and will give you output as String and pass it to mail activity in the body section to write into body of the mail.

1 Like

Hi
Welcome to uipath community
Hope these steps would help you resolve this
—use a excel application scope and pass the file
Path as input
—inside the scope use a read range and get the output with a variable of type datatable named dt
—next use a send outlook mail activity and mention the TO and SUBJECT property as we want
—now in body mention as
String.Join( “, ”,(From row in dt.AsEnumerable() Select Convert.Tostring(row(“ColumnName”))).ToList())

This will come as name1, name2, … as a single string in the body of the mail

Hope this would help you
Cheers @Kgk