How to filter OUT an email address?

Hi! I want to retrieve all emails from my inbox except emails from the email address noreply@forms.com. How do I do so?

Hi @Tiffany_Sajoto

Use Get Outlook Mail Messages to read the emails and store the output in a variable say mails

Use the below syntax in Assign Activity:

filteredMails = mails.Where(Function(mail) Not mail.From.Address.Equals("noreply@forms.com")).ToList()

filteredMails is of DataType List(System.Net.Mail.MailMessages.

Use For Each loop to iterate through filteredEmails and do your further process.

Hope it helps!!

Thanks so much!!! ^^

1 Like

You’re welcome @Tiffany_Sajoto

Happy Automation!!

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