How to use For each row when Column value is unique

Hello guys,

As the title says. How can I loop trough a datatable but only execute the activities when the value of a column is unique. Example:

row, number, name, value
1, 1901, Table, 20
2, 1901, Chair, 20
3, 1902, Screen, 20
4, 1902, Chair, 20
5, 1903, Table, 20

Now I want to: For each row (when Number = unique) THEN execute activities
So instead of executing the activities five times, I want to execute them 3 times because there are 3 unique values. Sidenote: I also use the number as a variable during the activites.

Hi @Peter_Peter

Use this expression, yourDT.DefaultView.ToTable(false, “ColumnName”)

1 Like


Filter the data tatable using Filter Data Table activity and the loop and trigger the action you want there inside the loop.


He wants distinct records based on Number Column. So we have to write True instead of false.


Try below expression to find unique records.

  yourDT.DefaultView.ToTable(True, “number”).CopyToDataTable
1 Like