# Delete duplicate row based on one column duplicate data

**URL:** <https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700>\
**Category:** Studio\
**Tags:** datatable, question, system, activities\
**Created:** [April 28, 2020, 5:53am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700 "2020-04-28T05:53:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit1](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@Ankit1](https://forum.uipath.com/u/Ankit1)\
**Post date:** [April 28, 2020, 5:53am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/1 "2020-04-28T05:53:59Z")

</div>

Hi,  
I want to delete rows that have the same data in a certain column. So for example I have 5 columns in my data table and a lot of rows.  
There are duplicates in ‘column 3’. I want to delete the entire row if there are duplicate codes in ‘column 3’ even though column 1,2,4 ,5 etc may not be duplicate.  
Only the first data row should be there, and duplicate should get deleted.

please help.

---

<div class="post-metadata">

**Author:** ![sandeep13](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sandeep13/32/79017_2.png) [@sandeep13](https://forum.uipath.com/u/sandeep13)\
**Post date:** [April 28, 2020, 7:18am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/2 "2020-04-28T07:18:51Z")

</div>

@Ankit1

> [@Remove duplicate rows based on a value from a single data column](https://forum.uipath.com/t/remove-duplicate-rows-based-on-a-value-from-a-single-data-column/36962/2):
>
> @banerjeerules check attached file i hope its useful [RemoveDuplicatesInSingleColumn.zip](https://global.discourse-cdn.com/uipath/original/3X/5/2/52911ef6fc95e4be8cb69034c3b46aaa35d08c67.zip) (12.8 KB)

---

<div class="post-metadata">

**Author:** ![Ankit1](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@Ankit1](https://forum.uipath.com/u/Ankit1)\
**Post date:** [April 28, 2020, 8:49am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/3 "2020-04-28T08:49:13Z")

</div>

Dear Sandeep, I tried it and ran the code.  
It ran fine but when I checked the output , the rows have not been deleted.

Also I guess the column which I am using is Mobile no, so integer type, but when I tried to change datatype to Integer or double, it gives error as “specified cast is not valid”  
And on running as string type, it gives no error , but also row dont get deleted.  
Please suggest

---

<div class="post-metadata">

**Author:** ![Ankit1](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@Ankit1](https://forum.uipath.com/u/Ankit1)\
**Post date:** [April 28, 2020, 8:57am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/4 "2020-04-28T08:57:55Z")

</div>

Also have attached the input data, based on column name Moile No., we have to delete duplicate row.  
Please see if you can help.[data.xlsx](https://forum.uipath.com/uploads/short-url/5WrfKx4EBFv8DPmEbIMw6vrfxq4.xlsx) (11.9 KB)

---

<div class="post-metadata">

**Author:** ![praneeth.peyyeti](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@praneeth.peyyeti](https://forum.uipath.com/u/praneeth.peyyeti)\
**Post date:** [April 28, 2020, 9:47am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/5 "2020-04-28T09:47:09Z")

</div>

[RemoveDuplicateRows.xaml](https://forum.uipath.com/uploads/short-url/2DFMxuwsS555o82iohyU3KIiVZY.xaml) (5.3 KB)

The above attached workflow will remove the repeated mobile number rows.

Thanks

---

<div class="post-metadata">

**Author:** ![Ankit1](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@Ankit1](https://forum.uipath.com/u/Ankit1)\
**Post date:** [April 28, 2020, 10:05am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/6 "2020-04-28T10:05:13Z")

</div>

Thanks Praneet, but i was expecting output in data table form

---

<div class="post-metadata">

**Author:** ![praneeth.peyyeti](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@praneeth.peyyeti](https://forum.uipath.com/u/praneeth.peyyeti)\
**Post date:** [April 28, 2020, 10:06am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/7 "2020-04-28T10:06:25Z")

</div>

just use this expression dt = arrDataRow.CopyToDataTable

---

<div class="post-metadata">

**Author:** ![Ankit1](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@Ankit1](https://forum.uipath.com/u/Ankit1)\
**Post date:** [April 29, 2020, 5:15am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/8 "2020-04-29T05:15:25Z")

</div>

No praneeth, even after using arrDataRow and using same code as you attached, the duplicates rows are not getting deleted.  
The process run fine but row do not get deleted 🙁

---

<div class="post-metadata">

**Author:** ![praneeth.peyyeti](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@praneeth.peyyeti](https://forum.uipath.com/u/praneeth.peyyeti)\
**Post date:** [April 29, 2020, 5:16am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/9 "2020-04-29T05:16:48Z")

</div>

can i have the xaml please.

---

<div class="post-metadata">

**Author:** ![Ankit1](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@Ankit1](https://forum.uipath.com/u/Ankit1)\
**Post date:** [April 29, 2020, 6:09am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/10 "2020-04-29T06:09:13Z")

</div>

Actually, it was my fault praneet. Sorry.  
Its working fine now

Thanks a lot… 😊

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [May 2, 2020, 6:09am UTC](https://forum.uipath.com/t/delete-duplicate-row-based-on-one-column-duplicate-data/217700/11 "2020-05-02T06:09:23Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
