cancel
Showing results for 
Search instead for 
Did you mean: 

Get Non Repeating Records from Collection (Review all Columns)

GabrielaEsquive
Level 3
Hi!

I have this action where i have a collection like this:

35324.png

And expect and ouptut like this: 

35325.png

This is my code stage: 

35326.png
35327.png
35328.png
How can I get it to review all columns to identify repeated records?

Up to now the Output is this:

35329.png

Thanks in advance!
2 REPLIES 2

PvD_SE
Level 12
Hi Gabriela,

I'd suggest to make a new column in the same collection. In the new column you combine all data from the other columns, eg Elena48Red and Miguel28Orange. You will end up getting two rows with Ray58Blue. Then you proceed to remove any rows that are duplicates in the new column. When this is done, you can remove the new column. All of this can be done in BP without the need of a Code stage.

No doubt, someone else will shortly post the code to accomplish the same. 🙂

Happy Coding!
----------------
Paul
Sweden
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Hi @Gabriela Esquivel,

You can remove the Field Name input parameter and modify your code in the following way:

Dim uniqueRows = (From row In Input_Collection.AsEnumerable()
                  Group row By a = String.Join(", ", row.ItemArray) Into grp = Group
                  Where grp.Count = 1
                  Select grp.First()).ToList()

Output_Collection = uniqueRows.CopyToDataTable()​


This way your grouping would be independent of any specific column and will take all column fields as grouping parameter.

------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------