How to get IMAP mails with Filter expression

Hi!
I have seen that not much is said about this new feature of Get IMAP Mail Messages (Filter Expression).
image
What I want to do is a get IMAP mails with Subject filters: Report and today’s date.
I have tried putting SUBJECT = Report but it gives me error
image

Hi Enzo!

When i try to filter mail messages, i use the information of next url:
https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/cc513841(v=office.12)?redirectedfrom=MSDN

PLease, check the section: “Outlook Query Languages” and you’ll find some examples. Maybe this helps you.

Hi

Let’s make it very simple

  1. Get the output mailmessage variable without any filter expression from get Imap mail activity named out_mailmessage

  2. Now use a FOR EACH activity and pass the above variable as input and change the type argument as System.Net.Mail.MailMessage in property panel

  3. Inside the loop use a If condition like this

Item.Subject.ToString.Contains(“Report”) AND CDate(item.Headers(“Date”)).ToString.Contains(Datetime.Now.ToString.SubString(0,10))

If true it will GO TO THEN part or to else

Cheers @Enzo