To Update datatable other than for each

Still Same Message. This topic is to glory1 and only Help to him should be Adressed in the Posts. Side discussions on Other topics, best practise etc can be started in Clean new topic.

Thanks a lot PPR. you made my day. One of the critical requirements of my proj’ is cleared. Thanks again n would mark the solution.

Thanks bcorrea for the valid suggestion. And yes, I practically verified ‘for each’ is good for lesser records and lots of conditions and updates.

And in my case with 75k data and single field update, PPR’s solution helped me (I did learn his code) and it took 1.28min, whereas ‘for each’ never ended even after 25min.

Thanks for all!

Im glad you are happy, but yours took 25 minutes because you did not have the join before the for each :slight_smile: and if you did learn all about linq statements from this post, you are one of those genius, and i become even happier to hear that! :smiley:

join_for_each.xaml (11.3 KB)

I’m wrong… for loop also executes faster!

As again I analysed, actually its not the for loop, but the excel app scope taking much time n never ending; And it happens only when 'm executing full run…
but if I debug(F11), it finishes in seconds… confused…

actually, i need to update the status of dt1 for matching records with dt2…
I don’t know how… so i used dt3.

I’ve added the simulated data n the code; request guidance for correction/fine-tuning.
Thanks!

@glory1
I had a quick review on your XAML. I encountered that now in dt3 only the common rows (3 rows) are present. From your requirements I understood, that the common rows should be updated to status “Cancelled” the other rows from dt1 should be part of dt1 as well. Also have a look on the structure, as by the nature of a join now differing from origin dt1 structure.

Have a look on this demo:
glory1_V3.xaml (11.4 KB)

Kindly note:

  • dt3 was used just for QA reasons, so you can compair the result with dt1, later the code can be changed to work directly on dt1 if this is wished
  • Approach is same: Find matching rows, then update its status, obtain a result of unmatched rows with origin status and matched rows with status “Cancelled”
  • with the freedom of using for each (X) a small implementation is possible well balancing between complexitiy and UiPath Essentials ( In our projects we do always focus on such solution approaches)

Happy automation

1 Like

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