Get Outlook Mail Filtering



I wanna know the filtering syntax and the limitation of the “Get Outlook Mail Message” activity.

Firstly, I tried to extract my outlook mails without filtering and use the syntax (MailMessage(0).from.ToString) to extract the sender info and the sender info I get is the following: “UiPath Help Desk”

  • Then I try to add a filter with the syntax of “[From]=’“UiPath Help Desk”’”. There is an error of .

but the It works fine with the filter of “[From]=‘Uipath Help Desk’”. May I konw the reason for the error?

  • Also, is it possible to make the filter more dynamic, like "[From]=’“UiPath Help *”.


Yes of course it is possible. Fetch the “FROM” string in a variable(ex:str_FromName) and check whether str_FromName.contains(“Uipath Help”).
Check and let me know whether it suits to your requirements…
Happy Automation.


What do you mean by Fetching the “FROM” string?


You can try this



Hi @karlkong,
Just put this in your filter of Get outlook email message.
"@SQL="“”" like ‘%UiPath Help%’"

Try it out and let me know.




When I was trying your solution, I got this error.

What is going wrong?


@karlkong Could you try and change the TypeArgument to MailMessage in the properties for the foreach activity. See if that works.


Yes. I’m trying to use the filter function of the get outlook message.

But I wanna know why I can’t get anything by using this syntax. “[From]=’“UiPath Help Desk”’"


HI @Avi7,
I try to find out more about your method, but i have real Problems to understand it.

Here is my issue:
I want to filter a Postbox for a specific email adress - prefix (
I cannot use From, because it only works with what it sees aparently.
[FROM]=‘Miller Peter’ works
[FROM]=‘’ does not work

[senderemailaddress]=‘’ works
but how do i do

If i copy your example and adapt it,so it might work i got an error.

“@SQL=”“”" like ‘’"
Get Mail Failed, Reason: Cannot parse condition. Error at “@SQL=(('…”.

So you i would really be happy, if you could explain how i can filter for a specific mail-ending-Thing(*
Because I cannot find much on that matter.


I did solve my own issue by adjusting the Code, but it only works for external mails though, but that must suffice. its only half pleasent for testing purposes.

I hope someone is learning something from my experience and discription, so here are my different Statements and what i learned:
From Statement:
“[FROM]=‘Mustermann Max’”
Sender Email Adress Statement:
Sender Email Adress with Wildcards
“@SQL=” & Chr(34) & “” & Chr(34) & " LIKE ‘’"