How can i proceed multiple excel rows containing the same N7decision info. And if the info in n7decision proceed 1 time only?

How can i proceed multiple excel rows containing the same N7decision info. And if the info in n7decision proceed 1 time only?

Exemple

Row 1 containing 999/111
Row 2 containing 999/111
Row 3 containing 999/111
Row 4 containing 998/144

I want that the bot proceed some columns of the rows containing the same number 999/111. So 3 time proceed some actions and then procedd row 4 alom as the number is different.

Thx for your help

Hi @mce

You can consider below approach:

  1. read excel data and save into datatable

  2. filter datatable to filter rows that contain 999/111 value.

  3. process this filtered data the way you want.

  4. filter the main datatable (from step 1) to filter the rows that don’t contain 999/111.

  5. now process this filtered datatable the way you require.

Or you can consider below:

  1. read excel data into datatable.

  2. loop through datatable, use if condition in the loop that if clcakye of certain column is 999/111, then do these specific steps .

  3. else do the steps that are meant for rows not containing 999/111.

Hope this helps.

Regards

Sonali

Thanks for your reply.
The problem is that sometimes I have the row 999/111 then it can be 999/111 then 888/145 then 777/623 then 999/188 etc etc..

So your solution will not works I think.
How to be able to read all the rows and saying if N7Decision column rows contains the same n decision then proceed each rows the number of times the row is duplicate otherwse proceed the row containing a unique N7Decision?

First, Read the Excel into a DataTable.

Then, get all unique values in the N7Decision column:
uniqueValues = dt.AsEnumerable().Select(Function(r) r(“N7Decision”).ToString).Distinct().ToList()

Once you have the list, then loop through each list values, and filter datatable for this list vlaue like
filteredDt = dt.AsEnumerable().
Where(Function(r) r(“N7Decision”).ToString = value).
CopyToDataTable()
Then for this you can do your steps for further based on each list.

Which variable type to select for uniqueValues and for filteredDT?

filteredDatatable – System.Data.DataTable
uniqueValues → List(Of String)

we can achive this by grouping the data and then proceed the groups and its group members. For some starter help have a look here:

[HowTo] Overview on different options for grouping data and processing the groups - News / Tutorials - UiPath Community Forum

Hi, it still doesnt work because it will consider as unique and will proceed always the info indicated in the first row instead of processing the info of the others rows containing the same N7decision.

I want to process each rows of the same N7decision in the same loop in for each to only create one invoice.

How can i do that ??

@mce

In that case, grouping should help as suggested by @ppr in above post.