How can i create an array of Datatables and loop through it?


I would like to create and loop through an array of Datatables (unknown number in each execution) and invoke a specific process which finds the sum of certain columns.

Could you please guide me in that/?



For each row?

How i can i create the array of datatables in order to use For each row?


Which database you mean here? SQL Database?

No, i am reading 5-8 csv files and creating datatables. Then i want to invoke the same process for all those datatables created

In that case you can use Directory.GetFiles(“FolderPath”,“File Extension”), this will give you an array then you can apply for each loop on it and perform operations on each file

Goto Variables panel —> Goto your variable —> variable type select Array of [T] -->select Browse for types, then search for DataTable

1 Like

Initialize a list of datatables and for each csv file read range and add to collection. Then you can simply loop through the list.

1 Like

Thanks bala! and how can i assign the datatables to the array dynamically?

Array Variables I think this should help you

1 Like

Use “Add to Collection” Activity