Sending Excel to duplicate emails

I have a table as follow:

Capture1

I have filtered the Excel table for each user, generating four output Excel files, i.e. one file per ‘Name’. Now I need to send those files to their corresponding email addresses. For the file with ‘Name1’, having two rows, it’s sending the same file twice to ‘name1@domain.com’. It should be sent only once. I tried those properties for distinct values, such as ‘arrayVariable.Distinct().ToArray()’ and 'table.DefaultView.ToTable(True,“Email”) but no success.

Any help with this? Cheers!

@Jasu:
Read only column A and B. (Range “A:B”) then use Remove duplicate rows activity.

@Jasu Check the below.

new11–.xaml (15.3 KB)

1 Like

Hey @Jasu

I do not know for you but it works.

you can find attached sample reference :slight_smile: - FindduplicatesInDT.xaml (10.4 KB)

Regards…!!
Aksh

2 Likes

Thanks. It works just fine :slight_smile:
One quick question: suppose if I have a fourth column (columnD) holding other values, let’s call it Value2. How to send those emails only if Value2-Value1 <= 1000?
Sorry, just learning UiPath and every information here in this forum is a great help.

1 Like

Thanks for the example, very useful.

@Jasu

  1. Read the input excel and store output in master datatable variable

  2. Using For each DataRow with input as master datatable

    a) Create new dattable with same structure as master dattable with build datatable activity.

    b) get the values from Value2 and Value1 columns.

    c) In IF condition check Value2-Value1 <= 1000

        i) If Value is true, copy that row from mater datatable to new datatable.
      
        ii)  Write new datatable to excel sheet with approriate name and send mail give same 
              path which u have used to create excel in send mail activity.
    
        iii)  if value is False do nothing