How to remove duplicates entries from Row and it should remove that entire Column

Hi Team,

I am trying to remove the duplicates from the row and want to get that entire column deleted.



Here I want to delete the Duplicate names and with the entire column.

Waiting for your valuable suggestion


You want to delete entire Row or Column ?

And also on which column base you want to delete duplicate records.

@lakshman from Column “Name” which are the duplicate values I am trying to delete that. :frowning:

Highlighte one I need to delete as it has duplicate names

1 Like

I’m assuming you want to delete rows and not columns since that wouldn’t make much sense.
Mydatatable.DefaultView.ToTable(true, “Name”) by using de parameter true you will only get unique values from a column. The second parameter is the column you want to filter. This will give you unique values from column name


Try below expression.

newDT = inputDT.Asenumerable().Gropyby(Function(a) a.Field(of string)(“Name”)).Select(Function(b) b.First()).CopyToDatatable()

Hi @Juan_Arriaga

Can you please give an example like how to proceed or it will be really helpful if you have a example XAML file

@lakshman Do you have any XAML file as example, as I am trying to understand the process from starting

Hi @Rahulsinha ,

It is from Datatable or Excel ?

If it is excel,you use the the below activity.

Remove Duplicates

Properties like this.




I don’t have any.

  1. First use Read Range activity to read the data from Excel file and will give you output as DataTable and say ‘inputDT’.

  2. And then use above expression to get unique records from input data based on Name Column.

  3. Finally use Write Range activity and pass that newDT to write into new excel file.

@lakshman Sorry, but where do I need to give the unique expression?

1 Like


You have to use Assign activity to write that above expression.

Getting error :frowning:


Are you saved your input data into inputDT variable or not. I.e. Read Range activity output

This is what I have done in Read range under Excel application scope



But in the above screenshot it is showing inputDT is not declared. Once go to variables panel and change scope of the variable and then try once.


what will be the scope here?


Are you writing above mentioned expression inside Excel application scope Activity or not ?

If not then change scope from do to entire workflow. If you click on that do scope field then drop down will come select last one in it.

First do a read range within an excel application scope to get your datatable.
you have to use an assign like this
dtUniqueColumnNamesValues = Mydatatable.DefaultView.ToTable(true, “Name”)
where dtUniqueColumnNamesValues is a new datatable with only unique values names. The name my “Mydatatable” is the name of your table. Then it depends on what you need to do with the unique names. you can use a for each in your table to read the columns and decide what you want to do.

please have a look


You have to create one more DataTable and named it as newDT and it should be on left hand side in Assign activity and Right hand site you have to write inputDT…

But you wrote Mydatatable…