How to process the unique values in excel

hi I have an excel file here my requirement is in column B (Client) Has duplicate values

so i want to take only one unique value from column B and process the invoice nos from Column A in the application

i want to ensure that once invoice nos which have same values corresponding to the column B shoud get break and process the next line in Column B

Attacting the sample data.
My data.xlsx (8.3 KB)

Assign Activity:
arrDistrinctClients | String Array =
dtData.AsEnumerable.Select(Function (x) x("Client").toString.Trim).Distinct().ToArray

However it looks also as a GroupBy Case

hi @T_Y_Raju
try this

DT.AsEnumerable().GroupBy(Function(row) row("column name").ToString()).Where(Function(g) g.Count() = 1).Select(Function(g) g.Key).FirstOrDefault()

add your cloumn name:)

will the query delete the duplicate values or omit it…i dont want to delete the duplicates it has run in the loop and when the condition is met it should take the next invoice number

can be modelled within the flow, when applying one of the shared groupBy approaches

can u explain in detail …iam not able to follow this

sure, we will assist. Just go through the shared resources and come back with your specific questions. Feel free to illustrate your needs with a more detailed output result

When it is about to get back all ColumnB values whicha are Unique and not duplicated we would do:

arrUniqueValues | String array =

(From d In dtData.AsEnumerable
Group d By k=d("Client").toString.Trim Into grp=Group
Where grp.Count = 1
Select v=k).toArray

but with your samples, the result will be an empty string Array

can u make a sample flow form the data which i provided Please

find some starter guidance:

  • we read the Excel Data into a DataTable - dtData
    then use an assign activity as mentioned above

Tracing / RnD & Prototyping can be done within the immediate panel
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

Basics like Excel readin is presented here: UiPath Academy

iam getting error plz find the snip of the same

you can use the mentioned immediate panel and inspect.

Kindly note: when there is a particular error and yo need assistance then share with us the details e.g. the error

With the mention of:

it may explain the issue

so use arrUniqueValues and inspect the array

when inspecting error is coming as Index was outside the bounds of Array

use immediate panel. type in arrUniqueValues and check the array
we assume that it is empty as we shared the reason above
or ther is only one item inside, then using (1) would fetch the second item, but there is no second item.

can u build a sample flow and show me the results if possible

Let us cut-off the ping-pong conversation. We recommend that you re-read all the posts from above and train some more basics a little bit more. Simply practice a few selected sub-steps of the overall modeling and then integrate them into the final process.
Just take your time and get pick-up once you are ready.

iam able to get the unique values from column B how can get how many invoice numbers are associated with that

output should be-218456 123 EZ overs
321678
378634

Hello @T_Y_Raju ,

In this case you have two option.

1 Get the excel sheet get the distinct value process the same

var distinctValues = dataTable.AsEnumerable()
                              .Select(row => row[columnName]) // Project each row to the desired column value
                              .Distinct() // Get distinct values
                              .ToList(); // Convert to a List (optional)

2 Push the data into DB

You can push data into database and put the logic for duplicate checks and process the unique record