How to get data of all rows of last column

How to get data of all rows of last column

2 Likes

Hi @bhavik_parekh
welcome to uipath community
–use a excel application scope activity and pass the file path as input
–use read range activty and get the output with a variable of type datatable named outdt
–use a for each row loop and pass the above variable outdt as input
–inside mention like this in writeline activity or use a assign activity with value as
row(outdt.Columns.Count-1).ToString
–this will print the value of all the row values in the last column of the table

Hope this would help you
Cheers @bhavik_parekh

1 Like

Hy @bhavik_parekh

You can refer the following program
Main.xaml (7.0 KB)

Thanks
Goutham Vijay

@Palaniyappan and @GouthamVijay Thanks for the reply, i actually achieved using below line of code
NewRowsDT.Select().CopyToDataTable().DefaultView.ToTable(False, “Responses”)

My table had Columns -> ID, Name, Responses

Now i need to remove the Header from the output Data table , how do i do that… In this Case i want to remove header name “Responses”

Fine, thats a good one
but i would like to suggest to go for this
NewRowsDT.DefaultView.ToTable(False, “Responses”)
and to remove the datatable header
–use write csv activity and uncheck add headers, pass the datatable as input
and the output will be a csv file, with data without headers

Cheers @bhavik_parekh

1 Like

so were we able to accomplish this
Cheers @bhavik_parekh

1 Like

@Palaniyappan Now how do i put the CSV data into a list of strings … ?

Can i Use this - > From row In DataWithOneColumnDT.AsEnumerable() Select Convert.Tostring(row(“Responses”)).ToList()

Fine

this would work if we are directly converting from datatable cheers @bhavik_parekh

@Palaniyappan Yes … I can do that instead of creating a CSV … but what should Variable Type to store this list … I am unable to find that

kindly search like this
system.collections.generic.list(of string)
make sure that the variable is initialised
with this new list(of string) as default value in the variable panel

@bhavik_parekh

image

@Palaniyappan Is this correct… ?

Yes perfect

But mention the default value as new list(of string) in the variable panel

@bhavik_parekh

1 Like

@Palaniyappan Thanks… :slight_smile:

Now i want to pass these List of strings in an Email as below (Items)
image

How do i do that … At present i have two strings in the List (ListOfStrings) and i have hardcoded as below in HTML

How do i make system automatically ready the length of ListOfStrings and put each one by one on it own in the HTML content… ?

Thanks in advanced… :slight_smile: … @Palaniyappan