How to get IMAP mails with Filter expression

I have seen that not much is said about this new feature of Get IMAP Mail Messages (Filter Expression).
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

Hi Enzo!

When i try to filter mail messages, i use the information of next url:

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


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