I have a process in which I need to get the emails that have the subject “Request” and also those that have the subject “Update”. How do I filter them?
Use can filter the subject using AND condition. By Putting Request AND Update and then filtering the data using above condition.
Regards
Naman Jain
You can use Filter Condition in the Get Outlook Mail Messages
For Example
“[Subject] = 'Request AND [Subject] = ‘Update’”
Use this as subject is going to be “Request” or “Update” not both at a time.
Set this as Filter property.
"[Subject] = 'subject1' OR [Subject] = 'subject2'"
Thanks,
Ashok
It works thank you very much
Sorry, there is no error when putting this code in the activity properties. But when I run it doesn’t filter, it doesn’t work. Sorry
Hi @Marisa_Ontiveros1 ,
You can read all mails & then filter out using below linq:-
filteredEmails = emailsList.Where(Function(email) email.Subject.Contains(“Request”) Or email.Subject.Contains(“Update”)).ToList()
FilteredEmails variable type will be same, as the output of get outlook mail message.
Thanks
→ Use Get Outlook Mail Messages activity in the properties panel provide the sufficient information like account,mailfolder,output etc.
→ Assign a variable "filter" and it’s value is MailMessages.Where(Function(mail) mail.Subject.ToLower.Contains(“request”) Or mail.Subject.ToLower.Contains(“update”)).ToList(). Variable type of filter is system.collection.generic.List<system.net.mail.mail message>. Here MailMessages is the output of Get Outlook Mail Messages activity.
->Use for each and provide an if condtion mail.Subject.Contains(“Request”) Or mail.Subject.Contains(“Update”)
→ Print the value
Thank you