Filter the Outlook mails By Filter Property Get Outlook Mail Activity

I need Urgent Help.

Actually, i want to filter the Outlook mails By Filter Property Get Outlook Mail Activity
I want the Subject of mail which contains some RR in with 5 Digits of Unique Code.

So Anybody can help please

1 Like

Could you please give an example of Subject mail so we can create the case

This works,

“@SQL=(”“urn:schemas:httpmail:subject”" LIKE ‘%"&YOURSUBJECT &"%’)"

Hi @ShekharRPA - Use Get Outlook Mail Message Activity and store the output in variable. Then use a For Each loop that should be in System.Net.Mail.MailMessage - Type Argument then inside the For Each you can Filter liker Item.Subject = “Your Filter”


1 Like

Could you please explain This Code more

Hi Shekhar,

“@SQL=(”“urn:schemas:httpmail:subject”" LIKE ‘%"&New ‘RR’ docket for claim&"%’)"

Place this code in Outlook Filter Property.
Whenever it matches an email with the subject line “New ‘RR’ docket for claim” it takes the mail and does necessary operations.

1 Like

@ShekharRPA Does it have to be in “Filter” Property of mail or you can use For each later on?
If you can use For each to loop thought Mail Messages this can be simple in IF statment

1 Like

Yes i know, I can use or dicision but I wanted to Use filter Property

1 Like

the Code which you have Shared me is showing an compiler error. I paste the same code in Filter property :frowning:

It is kinda confusing because forum changes the quotes. If you could paste this into property file and screeshot it or share it, since I am also interested in it

HI @ShekharRPA - Check this out


Please find the below workflow
Main.xaml (5.8 KB)


Hi @ShekharRPA ,

Please confirm if it’s working

Nice job, didn’t quite understand the logic behind the query but with this example it is good.
Just tell me, where did you find this piece of information: urn:schemas:httpmail:subject
How can I use it for different queries, something like Received Date, Sender etc…

Hi Rahul,

It is not showing error but it is not showing Message box on On your workflow.

It is an Outlook advanced search.
Refer to this article :

You change it to your desired result.
I have used message box to display how it recognizes that particular mail.
You can do your outlook operations inside the for each loop.
Change the mailfolder as well in Outlook

Nops, Still not working Parse Error

Do you have any other way for it with Filter Property

You were Right, Query is correct but the Problem is with Single & Double Quotes. Which i solved Later with Assign Activity