How to filter messages in Get outlook mail messages

You need to enclose the entire statement in quotes for it to work.

Hey bobpeers,

I know this sounds stupid but I don’t understand the syntax of where and when to mark quotes. Can you post how it would look like or elaborate in detail?

1 Like

@maurpalmenice Try below one

“[subject]=‘Daily HUB Report’ AND [ReceivedTime]>=’”&now.ToString(“yyyy/MM/dd”)&"’"

I just made this filter and it works for me

1 Like

Ok, it now works for me. Thank you @bobpeers and @Manjuts90 For everybody else with the same Problem. Don’t Copy the text out of the community forum and directly into the filter. You actually have to write it yourself as different fonts or something yield a problem.

Hi Vvaidya,
I am struggling with filtering only emails that have .xls or .xlsx as attachment… Could you please help me in this matter?
I would appreciate it.

Thanks in advance.

I have it!
For those who need it:
just put this into the Filter field: “[attachment]=’.xls’ OR [attachment]=’.xlsx’”
:slight_smile: happy coding!


well it doesn’t work…
I still keep getting all the emails regardless of the extension of attachment they have… Does anyone have some solution for this? Thanks!

@ajlakasic Try below post.

I can’t open your code properly…

and I know how to do it with if condition, but my problem is that i exactly need to filter the emails that i get based on the extensions… That means - to insert the filter into the “Get mail messages”… and not after it… do you know how to do that? :slight_smile: thank you

@ajlakasic i dont know bro

you can directly add this to the filter in the GetMailMessages directly.

haha :), thank you anyways… I did it on a more complicated way but it is not that optimal… :slight_smile:

1 Like

hi, yes, I did that already, but it seems like it is still not differing between the attachments since every single email is taken (also those with pdf, word etc attachments…)

last option is Once you have a list of mailmessages, have mail property MailMeassage.Attachments

and check the extension of attachment and filter.


is there any possibility to filter email based on attachment’s extension? Like I want to process only emails that contain xls files?.. (but i need this filter in the activity “Get outlook mail messages”… Please tell me that this is possible :slight_smile:

actually first filer does not allow wildcard use like *.xlsx so it wouldn’t suffice you requirement.
I did try to filter using attachments but it dosent allow

Hi All,

does anyone know how to filter by domain ?

1 Like