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?
Original Message:
Sent: 03-17-2023 11:00
From: Mukesh Kumar
Subject: How to remove duplicate value in collection
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
Original Message:
Sent: 03-17-2023 09:05
From: Nafiz Zainal
Subject: How to remove duplicate value in collection
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
Original Message:
Sent: 06-16-2022 14:20
From: Aravind Babu
Subject: How to remove duplicate value in collection
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
Original Message:
Sent: 06-16-2022 11:57
From: Devendra Maganti
Subject: How to remove duplicate value in collection
Hi Avinash,
iam getting whole CollA to CollB.
Thanks and Regards,
DevendraNath
------------------------------
Devendra Maganti
Original Message:
Sent: 07-16-2021 02:47
From: Avinash Ramkumar
Subject: How to remove duplicate value in collection
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
Original Message:
Sent: 07-15-2021 12:19
From: Rinesh Singh
Subject: How to remove duplicate value in collection
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
------------------------------