How can i add a datarow in a array list

I want to add a datarow to a arraylist, i don’t know how to do it in uipath since there is no way to write expression, pleae help me

@Bapum Can you tell us what are the current Steps that you are following involving data row and the list?

M just taking one by one row from a datatable. If the row satisfy one condition then m adding the whole row to a arraylist (type of filter)

@Bapum Ok. So I guess you are using For Each Row to Loop through the rows of a Datatable, Is arraylist of the type List(Of String) or List(Of Datarow)

Try the Add to collection activity? Set parameter as data row.

It is a list type

I just want to perform arraylist.add(drow(column Name))

And i tried add to collection activity, it doesn’t allow arraylist type of collection

lets assume you have a list<DataRow> and it is correctly initialized with new List(Of Datarow)
then with an add to collection (TypeArgument = DataRow) a Datarow can be added

In case of an nested list like list<list<DataRow>> the init can be done with
new List(Of List(Of DataRow))
grafik

Adding an element to this nested list can be done also with the add to xollection activity like this:
grafik

Adding a datarow to a particular nested list (e.g. first List) can be done as following:
grafik

1 Like