Hello guys, how to find data from DataTable that have same values; ex: people that have same address?

image

Hi,

Hope the following helps you

Sample20211107-1.zip (2.9 KB)

Regards,

1 Like

@Shamsa_Abd

Welcome to our UiPath community.

  1. Use Read Range activity to read the data from excel file and it will give output as DataTable. Let’s say InputDT.

  2. And then try below expression to get unique Addresses.

     UniqueAddressDT = InputDT.DefaultView.ToTable(True,"Address")
    
  3. And then use ForEach Row activity.

       ForEach row in UniqueAddressDT
             PeopleDT = InputDT.AsEnumerable.Where(Function(x) x("Address").ToString.Trim.ToLower.Equals(row("Address").ToString.Trim.ToLower).CopyToDataTable
    

Here, PeopleDT contains all users whose address is same.

Thanks @Yoichi ,it works. How to write all output in specified cell instead of message box? or even in specified column ?

image

Thanks @lakshman, what is x ? the expression of PeopleDT has an error

Hi,

How about the following?

Sample20211107-1v2.zip (3.3 KB)

Regards,

1 Like

Great, thanks @Yoichi for your quick help, appreciated.

1 Like

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