Enter data into excel such that same element doesn't enter twice

I need to extract and paste a series of serial numbers from subject of the mail to an excel sheet such that the same serial number doesn’t enter twice in excel sheet. I’m having difficulty in getting the right “If” Condition. If someone could help me with that I’d appreciate it…thanks

Inside the mail loop, You have to use another loop through the Datatable and then in If conditions you have to mention
row(“Columnname”).Equals(CrqSubj)

I tried that as well…it gives an error that says “Collection was modified; enumeration operation might not execute.” and the condition in the above screenshot enters the duplicate data

The first loop is your mail
The second loop will be your Datatable
Inside that row = mailsubject
If found then fine else add a data row
Outside both the Loop use write range

Can you share some screenshot of your workflow what you have tried?

image
This method uses the for each row for the datatable but it gives an error saying"For Each Row: Collection was modified; enumeration operation might not execute." which I am not able to figure out

What is the type argument of mail loop

System.Net.MailMessage

For each row
Row(“Columnname”).equals(Crq.subject) and put write range outside the loop

I tried that method…its gives the same error…Basically whenever I use for each row for the datatable I get that error and when I don’t, the if condition doesn’t work and the same element is entered twice