Comparing a Read Range to Get Outlook Mail Messages to Update a Column

Hi everyone, this might be a complicated one.

I have a read range of emails with a bunch of different columns. A few of them a sender, subject, and categories for emails.

I am trying to read the range of sender and subject and then getting outlook mail messages and seeing if the sender and subject are found in both then to update the category column.

For example if I got an email last week with the sender “john” and the subject “export file” that will be in my sheet, so when I look in the get outlook mail message it will find that email with john and export file and check if the category has updated, if so then the category column should be updated.

I hope that makes sense, it’s very niche but could be a powerful flow if I can get it to work.

  • For Each Email
    – If yourDT.AsEnumerable.Any(Function (x) currentEmail.Sender = x("Email").ToString AND currentEmail.Subject.Contains(x("Subject").ToString))
    — Then do the things you need to do

Thank you Paul that is definitely in the right direction. I am getting the error that sender and subject are not a member of integer.

Then something is not set up properly. Post a screenshot of your For Each Email activity and how it’s configured.

Don’t use Get Outlook Mail Message then For Each.

Use For Each Email which is a separate activity that literally loops through emails in a mailbox.