How to group rows and then read each element of each group?

Good afternoon friends;

I need your help please, I have a problem, I would like to group several rows, as long as it is the same item, after that read each element of column “B” from each of the groups of column “A”.

In the example, the bot would have to group the data of items 14, 15, 16, 17, 20

Then read the elements of group 14, it only has one, then it continues with the next group, in this case it is item 15 and it would have to read each of the rows of this group, there are 3. And so on with all the others.

I have consulted in the forum, but I have not explained myself well

I was thinking of creating with “for each” in datatable for each group of items, then with another “for each” iterate through the elements of it. But I don’t know how to do it or if there is another better solution

unique invoice.zip (71.8 KB)

I thank you in advance for all your helpstrong text

Hi,

Is your expected output like the following image?

img20220425-1

if so, the following will work.

Sample20220425-1.zip (8.6 KB)

Regards,

1 Like

Thank you very much for answering; But how could I make uipath perform actions on all the elements of a group then do other types of activities for the next group, so I would like to know when it changes from group to group of items

With a single for it goes through everything and does not allow me to notice when it changes groups, to carry out other activities

Hi,

I think it might be better to use IEnumerable<IGrouping<string,DataRow> instead of DataTable , as the following, for example.

unique invoicev2.zip (9.7 KB)

Regards,

Hi,

The following is based from the above image. Can you try this?

unique invoiceV4.zip (10.0 KB)

Regards,

1 Like

Thank you @Yoichi !!

1 Like

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