Speed up for each row loop

Hi I have a datatable of 20K rows and I have to loop through each row’s Record ID column and check if this Record ID exists in another datatable using Datatable.Select.

If it does not exists, then I would add that row into the datatable being filtered.
However this process is now taking over 1 hour to complete.
Is there anyway to hasten it?

In your Invoke Workflow are you passing data table as argument.?
if yes, this will take much time.
instead of passing data table as argument try to create flowchart inside your for loop.
Solution: Not to use Invoke workflow-just use flowchart.

4 Likes

Thanks. Also just realized I had it inside the for each loop which is not required. Now it is taking only 3 minutes.

2 Likes

Also would like to ask if I have two datatables
Datatable 1
Column A Column B Column C
001 Hello Bye

Datatable 2
Column A Column B Column C Column D
001 Hi Goodbye 1234

Is there a way to update Datatable 1 Column B and C to Datatable 2’s Column B and C values once I’ve matched Column A?
I’m currently using 2 for each loops and a if condition. If condition applies, then I would assign values for each Column.

take the values which you want to assign. and
you can just use row.item(columnB)=value,