Filter option in Get Outlook Mail Messages activity is not working

Earlier I am using Get Outlook Mail Messages activity to get the emails from Outlook without filter option (Just Account, Folder and Output emails). After getting all the emails from the specific folder I used to loop through all the emails to find the specific email with the text in the email body.

As my mails are being increased day by day. I was getting Timeout exception from Get Outlook Mail Messages activity.

Then I started using Filter option to check for the specific email with a text in the body as below
“@SQL=urn:schemas:httpmail:textdescription like '%”+textToSearchInMailBody+“%'”

This was working fine with my all old emails and now with the new emails that I received, it was not working. It is not able to find the email with the specific text in the body.

If anyone has an idea about this, please share your thoughts.

@Prathap_Reddy what version of Mail activities package are you using?

I’ve just run a test with 1.10.5 version and it worked as expected: Get Outlook Mail Messages returns emails containingIT Automation text in body. I tried with both filters from below:
“@SQL=urn:schemas:httpmail:textdescription like ‘%IT Automation%’”
“@SQL=”“urn:schemas:httpmail:textdescription”" like ‘%IT Automation%’"

Thanks for the reply @ovidiuponoran,

I am using 1.10.5 version only. I got your point. my issue is, the filter option is working fine with old emails in outlook that were already exists in the outlook. Today I got new emails in my outlook and for those the filter option is not working.

If you set another filter that returns the emails from today, does it work?
Something like “[Received] >= '” + DateTime.Today.ToString(“d”) + " 00:00AM’"

Yes! Its working with all other filters. But based on my requirement, i need to filter out the email based on the unique text in the email body. So i need to use the only filter option that was available “@SQL=”“urn:schemas:httpmail:textdescription”" like ‘%UiPath IT Automation%’".

If you have any idea please do share…

Indeed, this is strange. By any chance, is it possible to save such email as .msg and send it to me to check it in my test environment?

Unfortunately Sorry!!!

I can’t share the email (contains confidential data).
Have you tried with the new emails that was created today?

Understood. Yes, I tried with one email that I’ve sent to myself today and it is working fine.

Hi @ovidiuponoran,

Issue was resolved after I enable the cache in Outlook. Now filter in “Get Outlook Mail Messages” activity is working fine in finding the emails with specific text in the mail body.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.