GetIMAPMailMessage FilterExpression Subject Body

The GetIMAPMailMessage FilterExpression is by default set to ALL (to AND all the Criteria) but it does not appear to work if the Criteria includes SUBJECT and BODY, or SUBJECT and TEXT. It returns no matching email.

Examples of Working filters:
“FROM email.com BODY Citrix”
“FROM email.com SUBJECT 41” is same as: “ALL (FROM email.com) (SUBJECT 41)”

Examples that do NOT work:
“FROM email.com SUBJECT 41 BODY Citrix”
“SUBJECT 41 BODY Citrix”
“SUBJECT 41 TEXT Citrix”

I actually need to filter based on matching 3 criteria like:
“FROM email.com SUBJECT 41 BODY Citrix”
Adding the additional criteria does not matter, it is the Subject that doesn’t play well with BODY or TEXT

1 Like

Hi @FL.Duck,

Can you please elaborate a more on the issue, if I am getting right you require 3 filters to be applied on?? Correct.

Thanks

Yes I require at least 3 possibly 4. (FROM, SUBJECT, BODY (or TEXT), and possibly a second SUBJECT).
The fact that I can observe the issue with SUBJECT and either BODY or TEXT appears to be the root issue. The quantity of filters should not matter.

1 Like

Hi @FL.Duck,

Could you try inserting SUBJECT, BODY and TEXT values between TWO double quotes?

According to the documentation, it’s how we are supposed to do

https://docs.uipath.com/activities/docs/get-imap-mail-messages

If this solves your problem, kindly mark this post as solution to close this topic

If you need extra help and/or have any question, please let me know :slight_smile:

Thanks!

I stripped out all the quotes and made each a single word rather than a phrase. Same results using "SUBJECT ““41"” BODY ““Citrix””” Quotes are only required if the match contains spaces

1 Like

@FL.Duck

That’s strange

I’ve just tested here the following expression:

"SUBJECT ""Report Delivery"" FROM email@email.com BODY ""Date Run"""

It worked as expected.

Just to make sure… Have you checked OnlyUnreadMessages?

image

Perhaps, you have an email with these criterias but it is marked as read and you set to get only unread ones.

Had to remove images…

None of the email is read in that folder… unchecking has no change.
If I do NOT put SUBJECT and BODY in filter it works fine. any combination of those returns 0

I have UiPath Support engaged on this now.

1 Like

@FL.Duck,

Have you informed the correct folder name?

image

Inbox was just an example

If this is not the reason, my last advice would be to verify that the account configured in the activity is exactly the same as the one you verified the emails.

Yes, it’s the Inbox. The only change I make is the filter. With SUBJECT and BODY nothing returned, with SUBJECT OR BODY I get all matching emails

1 Like

Got it @FL.Duck

Feel free to share the solution when you receive the response from UiPath Support and find out what’s causing this error.