How to select row from different datatable with identifiers

Hi everyone!

I have problem. I have large datatable +25000 lines (lets call it master table). For that datatable I need to fetch data from 5 other datatables. Now I do it using for each row inside other for each row and it takes ~10h to finish. For every line on master table there is 0 or 1 line on other tables.

So the question: is there syntax where I can use master table identifiers (two identifiers per line) to fetch wanted line from other table without looping whole table.

I was thinking putting select.where inside try catch but I can’t get the syntax right.

1 Like

Welcome to uipath community
we can do one thing
if we want to fetch it from 5 different datatable to a single final datatable
use five different FOR EACH ROW activity with those five datatable passed as input and inside each loop use a ADD DATAROW activity where mention the datatable as FINALDT and the array row property as row.ItemArray in the property panel

so here we are not looping one for each row loop within another rather we use individual one and add the datarow to the final datatable we want .so it wont take much time

hope this would help you
cheers @Playester

Thanks for quick reply,

I forgot to add that on master table I add 9 new columns where for each row I fetch the cell value for those added columns from those 5 tables.

So on start on master on each row there is 5 columns and on end result there should be same number of rows and 14 columns with filled data.

For solution:

Create excel-file where is wanted columns read it to dt, copy master data to it and loop side tables using command dt.Select().Where(Function(x) x(“Fruit”).ToString.Trim.ToLower.Equals(row(“Fruit”).ToString.Trim)).AsEnumerable().Any() to get right row and on right row use normal assign “row(Price) = dtRow(Price)” to fill blanks on master data.

With this it takes less than hour to run it so 10h vs 1h is pretty big time saver.

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