Grab multiple row data based on cell value

Hello all,
I am having formula issue in conjunction with my data table filtering.
I would like to send emails out based on the PO’s (column A) in my DT and then reference the values in columns B - D. The HTML I do understand but I am having issue where more than 1 line has the same PO (row 4 - 7 & row 8 - 11). For these ones, I would like to send just one email to the contact with all 4 lines referenced instead of 4 separate emails. Attachments and screenshots below. Thank you

ex2 ex1 example sheet.xlsx (8.4 KB)

1 Like

Hello @D_Tee

I had once almost the same issue, check below example, this might give you a glance :point_down:

sendMail.zip (44.1 KB)

Thank you for the reply mz3bel. I do not see how the attached would prevent duplicate emails being sent out when there are duplicate PO_ID’s in column A.
Take lines 10 & 11 in the image for example.
Rather than 2 separate emails stating the values in columns B - D, (1 for row 10, 1 for row 11), I’d like it to realize that there are 2 rows with the same PO_ID value, consolidate and send 1 email with both rows referenced.
Thank you

1 Like

@D_Tee

Sorry for the delay, add this after the read range :point_down:

dt_data = dt_data.DefaultView.ToTable(true, “File_Name”, “Emails”)

This will take only the rows that are not duplicated, on both columns.

Let me know if it works for you :slight_smile:

Thank you for the quick response mz3bel. This was helpful for the chain email mail outs but I am still having problem with the consolidation. In the table, I’d like it to include the info from “order”, “open”, “received”, and “line” in the email, BUT if there are duplicate PO’s (value in column 0), I’d like to to combine them all into one email.
So in the picture below, row 2 for P01-177576 would just be 1 email referencing 8, 8, 0 ,1.
But for Row 4 -7, they are duplicate PO value, so I’d like it do only send ONE email (the PO is linked to the email) instead of 4 that still references the values from B4 to E7 in that one email.

Thank you!

ex3

1 Like

Did you do this? Because with that you wont have duplicate rows. Give a try and let me know.

I did add in that step, it looked a little different with the column names like so:
dt_data.DefaultView.ToTable(true, “PO_ID”, “Order”, “Open”, “Received”, “Line”)

1 Like

@mz3bel

1 Like

@D_Tee

So, after adding, did it work for you ?

@mz3bel no not really. That default view was included in the steps for the screenshot above

1 Like

@D_Tee

Check this out and let me know if it works for you :point_down:

sendMail.zip (32.1 KB)

example sheet.xlsx (9.0 KB)

1 Like

Thank you again mz3bel, I’ll load this up and take a look.

1 Like