Remove duplicates from collection

maduri0909

New Member
Hi

I have fields of NAME,AGE,RANK,NUMBER in collection.
If i want to delete the rows if age and name in one row matches with another row in same collection..

How to do it

For one field collection contains value will work..but to consider duplicates of 2 fields..

Please help me out..
 

justinjobp

New Member
Hi Maduri,

You can either use the code stage and loop the entire data and remove the duplicates from the collection. Or you can use the macro file, by which you can remove the duplicates after pasting in the macro excel fille. After removing the duplicates take the remaining data from macro file into collection.
 
This is very easy I can help you out

PFA for this it may help, please let me know if you need any help on this.
Just change the code option to C# in Initialize page of the object, any way its already selected in the given object by me.
 

Attachments

  • BPA Object - Rmove Duplicate rows.zip
    2.3 KB · Views: 458

maduri0909

New Member
This is very easy I can help you out

PFA for this it may help, please let me know if you need any help on this.
Just change the code option to C# in Initialize page of the object, any way its already selected in the given object by me.
Thankyou..i will check this and let you know
 

Nyesha

New Member
I have a similar issue except I have two collections I am trying to combine into one unique collection.

I have tried various loop variations but as yet I am unable to come up with a solution.
 

jaganrpa

New Member
This is very easy I can help you out

PFA for this it may help, please let me know if you need any help on this.
Just change the code option to C# in Initialize page of the object, any way its already selected in the given object by me.
Thanks for the code.

I have used your code for my VBO.

Im getting compile error (Im new for .Net). Please find the screenshot.
 

Attachments

  • Compile Error.PNG
    38.6 KB · Views: 148
Please directly import the object provided by me.... And if you are writing the object in a new object,then please change the code to .net in the initialize page of the object then there will no complication error
 

Nyesha

New Member
You can give some more clarity....... if two collections contains same fields, you can append both the collection
Hi, I have resolved this. But I was doing a reconciliation and I needed only items that were not duplicate.

so I have a collection I import in to blue prism from SQL, this is my master and I have an excel file I import into blue prism as a collection. The excel import contains duplicates of items found in my master so I needed to do a reconciliation to isolate all of the non duplicated items so I could update my SQL collection with only unique items. I couldn't find a collection object item that would do this.

I resolved this issue by looping through my SQL collection with my excel collection and adding a count column to my excel collection. I included a decision so every time I came across a duplicate I would add a ridiculously large number 10000000000 when a duplicate was found and 1 when it wasn't a duplicate. I then filtered on ridiculously large number and used another loop to create a new collection of only unique items.

It is possibly a long way to resolve the issue, if any one is able to create an object that would take in two collections and create an output collection where you could decide if you wanted your results to be true or false where false is all items that are not duplicate and true is where items are duplicates that would be useful, or if you are able to suggest a simpler solution that will be great, but for the moment, I have got around my issue for the time being. I could have possibly done a reconciliation outside of blue prism in SQL creating a new table and updating my master with only unique items, this is an option still but I wanted to use blue prism as my process involves a lot of reconciliations.
 
Last edited:
This is very easy I can help you out

PFA for this it may help, please let me know if you need any help on this.
Just change the code option to C# in Initialize page of the object, any way its already selected in the given object by me.

Hi,

I made a change in the code to get the two columns that need to remove the duplicates from two data items, but in the output it is taking only the two columns and not all of the collection, can you help me?
This is very easy I can help you out

PFA for this it may help, please let me know if you need any help on this.
Just change the code option to C# in Initialize page of the object, any way its already selected in the given object by me.
 

Attachments

  • cod.PNG
    5.5 KB · Views: 164
  • start.PNG
    14.4 KB · Views: 120
  • action.PNG
    9.2 KB · Views: 108
This is very easy I can help you out

PFA for this it may help, please let me know if you need any help on this.

Just change the code option to C# in Initialize page of the object, any way its already selected in the given object by me.
please help me, I modified the object code a little to remove the duplicate values of the collection from two data items, in the output it is taking only the two columns instead of taking all the columns of the collection. I send you print
 

Attachments

  • start.PNG
    14.4 KB · Views: 95
  • cod.PNG
    5.5 KB · Views: 84
  • action.PNG
    9.2 KB · Views: 58
  • Data R12.PNG
    45.1 KB · Views: 58
  • Output.PNG
    25.7 KB · Views: 65
Hey you will get only two columns because if you want whole row then you need to give all columns name.
For example 1st row(1,2,3,4,5) and 2nd row(1,2,8,9,0) then how bot will know to delete which row by comparing only 1,2 then it may delete 1st row or 2nd row..

Please let me know if still you have doubt
 

prasannakumark

New Member
Hey you will get only two columns because if you want whole row then you need to give all columns name.
For example 1st row(1,2,3,4,5) and 2nd row(1,2,8,9,0) then how bot will know to delete which row by comparing only 1,2 then it may delete 1st row or 2nd row..

Please let me know if still you have doubt
Hey can u plz elaborate it
 

balbertelli

New Member
Stumbled on this thread from the world wide web:

I faced a situation that required the checking of duplicates, and I used the Work Queues VBO action "Is Item in Queue" to verify an item's uniqueness. If the unique id didn't already exist in the queue, then add the record to the queue. Loop it through your data set, use "Get Data," or create a "Get Next Item process, and you're off to the races!

The data set I was working with consisted of customer number, ship to location, PO#, and a bunch of other columns. The process required we create to create two sets of data: Jobs and Items.

Each record had to go to the Items queue. Not every record was a unique Job. The Jobs consist of all items being shipped to one location.

View attachment 1562862737944.png

I have an accounting background, so no coding experience. Utility-Collection Manipulation was quite helpful to get rid of junky columns. I found a guide on the portal for excel macros best practices:

https://portal.blueprism.com/documents/excel-automation-guide
https://portal.blueprism.com/documents/extending-ms-excel-vbo

Remember, it gets harder to scale what you build the more code you use!

Have a great day,
BA
 
Top