Need to get unique value from specific columns


I want to get unique value from excel from Email Address column and I want to print those unique value.

PFB sample data

|Assignment No|Email Addess|

Most easy way is the following:
1/ read the “Email Addess” column to data table
2/ use activity “Remove Duplicate Rows” to get unique values
3/ use activity “Output Data Table” to convert DT to a string
4/ print the string


Give a try on following
Assign Statement
Left Side: dtUniqueEmails (Datatype: datatable)
Right Side: yourOriginDTVar.defaultview.totable(true,{“Email Addess”})

IT will Return a datatable with one column and the unique Email ids

As an alternate we can fetch the unique values into a e.g. string array
dtData.AsEnumerable.Select(Function (r) r("Column1").toString.Trim).Distinct().toArray()

the output can be adopted as by your needs. Find a sample for seperating each value with a line break:
String.Join(Environment.NewLine, arrValues)

find starter help for this here:
DT_1Col_ToArray_Distinct.xaml (7.0 KB)

1 Like

Hi @Javed_Ansari

check this workflow

Main.xaml (6.2 KB)

it will give an output like this

(upload://4S7jLz7aBJ0p3f9g8ieFz0ReRFi.xaml) (6.2 KB)