Use Filter property on GetOutlookMailMessages activity - Outlook 2016


I’m doing a worfklow that reads eMails from the Outlook 2016 application but I need to get specific eMails with the Filter property from the “Get outlook mail messages activity”. When I don’t have any string on the Filter property, everything works correctly. When I try to use a string as a filter, nothing shows up after my iteration.

I’ve been reading some other similar issues but so far, I can be wrong, didn’t found a solution. Here is my workflow at the moment:

@moreirasa1 May be unread mails with that subject doesn’t exist. If want u get mails which are unread also, Uncheck OnlyUnreadMessages option in properties panel. Otherwise Ur mail subject contains just Surf word, it maight also contains other words along with Surf. Check these two things.

@Manjuts90 Thanks for your tip but I already double checked that. I have indeed eMails with the “Surf” subject yet to be read. In fact, I unchecked and checked that Filter option in both ways and no eMail was detected. The weirdest thing is that, the Output doesn’t even give me any error.

@moreirasa1 if subject contains extra one letter also not work including space. Please check it.

@Manjuts90 Since you mentioned that, is it possible to use some string like “[subject]=’%Surf%’” or “[subject]=’* Surf *’”? Do you know if there’s some alternative if the subject contains more than just the surf word? Thanks in advance.

@moreirasa1 I think we dont have such options. Alternatively we do like as follows Don’t give any filter in properties. Inside for loop take one if activity and then filter Item.Subject.contains(“Surf”). Then u will get desired results.

1 Like

@Manjuts90 Your idea would probably work indeed. However, I found a solution based on some sort of SQL query. Here it is: “@SQL=” & Chr(34) & “urn:schemas:httpmail:subject” & Chr(34) & "Like ‘%Surf%’"