Hi Balaji R,
One option would be to add a new column to the Original collection that will act as a combined key for that row.
This new column will contain the combination of Trainer and Salary columns as below.
(The duplicates are marked in Yellow and Blue)
- The new column can be added from the BP action. It is up to you where to add the new column and the data for it, whether in the Excel or in the Collection, but later has to be deleted.
- This will involve looping and adding the data to the new column. So this approach will be feasible to you only if you have less rows in the collection but I will explain it below and you can make the decision.
-Once the data is populated in the combined column, make a copy of the Original collection (single action in Blue Prism) and lets say it is called as the Destination collection.
-Loop on the Original collection, check if the Combined column of the Original collection is present in the combined column of the Destination collection. This can be done by the same 'Collection contains value' action as explained in the above post.
- If Found delete that row from the Destination collection. Again this is a single action available in Blue Prism
- Once the loop is over the resulting Destination collection will be the one with unique data.
- Delete the Combined column. To delete a column of collection is a single action available in BP.
Another quicker and best approach is the code stage.
Write a code that will mimic the already existing Remove Duplicates functionality of Excel.
From the Code you can call the Remove Duplicates method of Excel.
When manually done as below will give the same results when done through the code since we are calling the same functionality.
Remove Duplicates:
Before:
After:
The duplicate rows marked in Yellow and Blue above are now only appearing once.