Blue Prism Product

 View Only
last person joined: 13 hours ago 

This community covers the core Blue Prism RPA product.

Expand all | Collapse all

How to remove duplicate value in collection

  • 1.  How to remove duplicate value in collection

    Posted 07-15-2021 12:20
    Hi there, 

    Hope someone can assist with the below please.

    I have a collection which contains 2 columns of data. [ID Number] and [Surname]. I would like to remove duplicate ID numbers from this collection and place them into another collection. So i will be left with only unique ID numbers in my original collections.

    Does anyone know how I could do this without the use of a code stage.

    Thank you

    ------------------------------
    Rinesh Singh
    ------------------------------


  • 2.  RE: How to remove duplicate value in collection

    Posted 07-15-2021 13:01
    @Rinesh Singh,you can be using the action remove duplicates from the collection manipulation, if you don't have this vbo follow the asset link in our DX
    Blue Prism Digital Exchange

    ------------------------------
    Emerson Ferreira
    Sr Business Analyst
    Avanade Brasil
    America/Recife
    +5581988869544
    If my answer helped you? Mark as useful!
    ------------------------------



  • 3.  RE: How to remove duplicate value in collection

    Posted 07-15-2021 13:48
    Hi Emerson, 

    Thank you for your help!

    I have had a look at the package on the link you provided but  it does not make mention of "remove duplicates", The guide for vbo outlines the below as included in this asset.  

    Options included in the utility:
    • Append Field (Number)
    • Append Field (Text)
    • Append Rows to Collection
    • Collection Contains Field
    • Collection Contains Value
    • Copy Rows
    • Delete Column
    • Delete Field
    • Field Exists
    • Fill Blanks
    • Filter Collection
    • Get Collection Fields
    • Merge Collection
    • Read Collection Field
    • Remove dots from headers
    • Remove Empty Rows
    • Remove Null Rows
    • Rename Collection Fields
    • Rename Field
    • Reverse Collection
    • Set Collection Field
    • Set Column Names From Expected Collection
    • Set Column Names From First Row
    • Sort Collection
    • Split Collection
    • Transpose Collection

    ------------------------------
    Rinesh Singh
    ------------------------------



  • 4.  RE: How to remove duplicate value in collection

    Posted 07-15-2021 14:24
    Try adding a new action to VBO
    Write a code stage with this code
    Dim pNewDataTable As DataTable
    Dim pCurrentRowCopy As DataRow
    Dim pColumnList As New List(Of String)
    Dim pColumn As DataColumn
    
    
    For Each pColumn In Input_Col.Columns
    	pColumnList.Add(pColumn.ColumnName)
    Next
    
    pNewDataTable = Input_Col.DefaultView.ToTable(True, pColumnList.ToArray)
    
    Out_Col = Input_Col.Clone
    
    For Each pCurrentRowCopy In pNewDataTable.Rows
    	Out_Col.ImportRow(pCurrentRowCopy)
    Next​
    And make the following outputs and inputs


    Input:


    Output:





    ------------------------------
    Emerson Ferreira
    Sr Business Analyst
    Avanade Brasil
    America/Recife
    +5581988869544
    If my answer helped you? Mark as useful!
    ------------------------------



  • 5.  RE: How to remove duplicate value in collection

    Posted 07-15-2021 20:30
    thanks once again Emerson but unfortunately using code is not an option in our business. Was really hoping for a no code solution.

    ------------------------------
    Rinesh Singh
    ------------------------------



  • 6.  RE: How to remove duplicate value in collection
    Best Answer

    Posted 07-16-2021 02:47

    Hi Rinesh,

    Using code stages/custom object is easier.
    But if your business has restrictions, could try the below method.
    1) Create an empty collection (ColB), assume existing collection is ColA
    2) Do a nested loop starting with ColA, if row does not exist in ColB, add row to ColB.
    3) You can choose whether to delete or retain the copied row in ColA.

    Hope this helps.

    Thanks,

    Avinash



    ------------------------------
    Avinash Ramkumar
    ------------------------------



  • 7.  RE: How to remove duplicate value in collection

    Posted 07-16-2021 07:50
    Thanks Avinash, let me try this and will feedback here once I am done.

    ------------------------------
    Rinesh Singh
    ------------------------------



  • 8.  RE: How to remove duplicate value in collection

    Posted 07-16-2021 10:55
    @Emerson Ferreira

    i have an error on line 3​ when pasting into code stage, How can i correct it error?

    Thank you




    ------------------------------
    Jiri Husner
    ------------------------------



  • 9.  RE: How to remove duplicate value in collection

    Posted 07-16-2021 14:40
    Sorry, I just missed an important part, please do not initialize your object declare the following DLL and Namespaces


    ------------------------------
    Emerson Ferreira
    Sr Business Analyst
    Avanade Brasil
    America/Recife
    +5581988869544
    If my answer helped you? Mark as useful!
    ------------------------------



  • 10.  RE: How to remove duplicate value in collection

    Posted 06-16-2022 11:57
      |   view attached
    Hi Avinash,
    iam getting whole CollA to CollB.

    Thanks and Regards,
    DevendraNath

    ------------------------------
    Devendra Maganti
    ------------------------------



  • 11.  RE: How to remove duplicate value in collection

    Posted 06-16-2022 12:11
    hello @Devendra Maganti - you are not doing in correct way. Data1 and data2 are two collections.
    you need to take reference of column of that collection like Data1.x and check the value in other collection.

    P.S - go with code approach. extend your vbo with code stage. That will save the iteration time of collection.


    ------------------------------
    Neeraj Kumar
    Technical Architect
    ------------------------------



  • 12.  RE: How to remove duplicate value in collection

    Posted 06-16-2022 14:20

    Hi Devandra, 

    Steps to be followed here is.
    1. Take one empty collection assume it Coll B and assuming existing collection is A.
    2. Now start loop for Coll A
    3. Start Loop for Coll B
    4. Compare both collection values , If Yes do nothing, If No copy the coll A value to Coll B
    5.Loop Coll B Ends.
    6. Loop Coll A Ends.



    ------------------------------
    Aravind Babu
    ------------------------------



  • 13.  RE: How to remove duplicate value in collection

    Posted 14 days ago

    Hi Aravind,


    Is this the solution u suggested? I did it but it didn't get to the decision stage in the loop. I need to check  duplicates for 2 out of 3 column. Means that the value in column 1 AND column 2 should not have any duplicate in other rows.

    Thanks



    ------------------------------
    Nafiz Zainal
    ------------------------------



  • 14.  RE: How to remove duplicate value in collection

    Posted 14 days ago

    Hi Nafiz

    Please can you paste the syntax in decision stage

    and one more thing is there any restriction in using code stage.

    Regards

    Lakshmi Narayana



    ------------------------------
    Lakshmi Narayana
    ------------------------------



  • 15.  RE: How to remove duplicate value in collection

    Posted 14 days ago

    Hi @Nafiz Zainal 

    Kindly go with the code stage rather than looping the collections as it might take longer iteration time when the collections are fully loaded, as suggested above by @Neeraj Kumar and you can find the code by Emerson Ferreira in the above discussion.

    Its a One liner code to be specific ( Collection_Out=Collection_In.DefaultView.ToTable(true) ) , follow this approach if you are facing any difficulties implementing above approaches:

    Process :

    Object : Add an Action in one of your existing collection manipulation extended objects or create a new object and check the required Dll and Namespaes in the Initialize page> code options:

    Add an Action page and add input and output collection and write below code:

    Collection_Out=Collection_In.DefaultView.ToTable(true)



    ------------------------------
    Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.

    Regards,

    Mukesh Kumar - Senior Automation Developer

    NHS England, United Kingdom, GB
    ------------------------------



  • 16.  RE: How to remove duplicate value in collection

    Posted 11 days ago

    Hi Mukesh,

    Is this going to work when I need to check only 2 columns with same value out of multiple columns? Here I attached the screenshot:

    You can see I need to check for duplicate only for column 1 and column 3. What I need to do now is to remove Row 4 from Coll1 and add it into Coll2. Is the code stage possible for this scenario?



    ------------------------------
    Nafiz Zainal
    ------------------------------



Welcome to the Blue Prism RPA Product Community!

Whether you’re looking to manage a complex infrastructure, maintain security and compliance, bring new products to market faster, or gain operational speed and agility in an uncertain economy, Blue Prism delivers — with the flexibility you need to create the business you want. From deployment on-premise, through a cloud service provider or as SaaS, to a skillful and adaptable digital workforce that continually expands to meet your enterprise needs, you can gain enhanced operational insight and control while your people reclaim the time they need to focus on great work.

Product PageKnowledge BaseBlue Prism Training Offering
Product Research ProgramUpdates, Releases & Announcements

FAQs

Blue Prism is intelligent automation — business-developed, no-code automation that pushes the boundaries of robotic process automation (RPA) to deliver value across any business process in a connected enterprise.

A combination of RPA with expanded cognitive and AI capabilities, Blue Prism is different than other automation technology on the market. With one Blue Prism license, you gain instant access to an already AI equipped digital workforce, along with the tools you need to build and delegate automations. Click here for more information on Blue Prism and Intelligent Automation.
To learn more about how Blue Prism RPA can help your organization and how much it will cost to get started, please Contact our Sales department.
Blue Prism RPA can be downloaded from our customer portal. If you would like to consume or download any material it is necessary to create an account on the Portal. Once you have registered, you can access the download options for Blue Prism here.
Yes! Installed on your own machine and supported by our training materials and product documentation, you can use all the features of the full enterprise product for free with our Blue Prism Trial – giving you the opportunity to learn the basics before moving to a full production implementation. Click here for more information and to download the trial.
Yes! You can access our known issue list for Blue Prism from our Support Portal.
Regardless of your industry, Blue Prism’s Digital Workforce can adhere to strict governance and compliance standards without limiting productivity. Click here for more information on how your industry can benefit from Blue Prism.