How to send out email base on excel column data

Dear Expert

I have a request as below:

If “Mismatch” exist in any column from Result1 or Result2 or Result3 or Result4 or Result5 or Result6, send out email template A to customers

All I need is ONE email if “Mismatch” exist in these columns. I don’t care how many or which columns it exist in

If Result1 and Result2 and Result3 and Result4 and Result5 and Result6 are ALL with “Match”, them send out email template B to customers(also only ONE email needed)

I try below solution but it doesn’t work


image

Sample.xlsx (9.5 KB)

Thank you for your help in advance :grinning:

Ivan

Hi @yangyq10

Use below query to find any Mismatch is there

hasMismatch = dt.AsEnumerable().Any(Function(row) row("Result1").ToString.Equals("Mismatch") OrElse
                                                             row("Result2").ToString.Equals("Mismatch") OrElse
                                                             row("Result3").ToString.Equals("Mismatch") OrElse
                                                             row("Result4").ToString.Equals("Mismatch") OrElse
                                                             row("Result5").ToString.Equals("Mismatch") OrElse
                                                             row("Result6").ToString.Equals("Mismatch"))

Regards,

1 Like

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