How would I filter for specific email sender/subject in 'if' activity?

Hi there,

Apologies as I’m new to this: I’m using a for each loop for unread emails and I want to input an ‘if’ activity after.

So for example: if the email address is from specificperson@email.com with the subject of ‘new enquiry’ then I want it to catagorise it as one variable, else, catagorise it as a different variable. There will be four different possible variations for this, so I need each email type to have its own variable.

I can get the code to be either sender OR subject, but not both?

Thanks for your help.

@dr1992

Welcome to our UiPath community.

Use AND operator between both the conditions to check for those conditions.

      ForEach item in mailMessages
          IF item.Subject.ToString.Equals.ToLower.("new enquiry") AND item.sender.ToString.Equals("specificperson@email.com")

Thanks for your help Iakshman!

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