Get exchange Mail Messages - date received

I’m getting issue with filtering MailMessages by activity Get Exchange Mail Message. When I am using attachement, subject or body filtering its all working. Its also fine with yesterday, today, this week as received option.

But when I put this filter option:
“received:06/09/2021” - it gives me 0 results
“received:09/06/2021” - it gives me 2 results, one mail is 10 Jun 2021, another one is 09 Jun 2021 (there is almost 24h difference between them!)

image

I tried also to use this option:
“received: >05/05/2021” and “received:>05/05/2021” but it give me no results. My other options:

image

Why is that? Is it UiPath package fault?

I used 1.10.5 version of UiPath.Mail.Activities

Hello @Yameso!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff

Hi @Yameso

I asked around and it looks like it is not a bug on the activity side because it just passes the filter along to the server, and whatever the server gives back is what you get.

It might also be related to the D/M/Y vs M/D/Y format.

Why then this one gives me 0 result:

“received:>05/05/2021”

and this one give me 2 results?

“received:09/06/2021”

It is indeed strange, but apparently, that’s the same result if you would run the query manually on the server itself.

@Yameso - please check this post …result changes when we add time component to it…

@Yameso The implementation of this activity just passes the query string to the server. The query string should be defined as described here Perform an AQS search by using EWS in Exchange | Microsoft Docs

“received:09/06/2021” should give you 0 results because this is September 06, 2021. You can rewrite your filter as “received:June 09,2021".

You may get what looks like strange results because the filter is interpreted in the time zone of the server but what you display in Output window is the DateReceived/Date converted to the local time zone on your machine.

CC: @ovidiu.iliescu

1 Like

I wrote that this gives me results:

“received:09/06/2021” - it gives me 2 results, one mail is 10 Jun 2021, another one is 09 Jun 2021 (there is almost 24h difference between them!)

This format gives me 0 mail:

“received:06/09/2021” - it gives me 0 results

Another thing - I wanted to rewrite my old solution with Get Outlook MailMessage to Get Exchange Mail Message. As Filter i used:

subject:[XYZ] Bla bla bla AND subject:OK AND received:today AND from:"xyz@domain.com"

There was mails matching those criteria but it gives me 0 results. So I changed it to:

subject:Bla bla bla AND subject:OK AND received:today AND from:"xyz@domain.com"

And it worked. But on the next day it stopped. To be funny the first one did well again:

subject:[XYZ] Bla bla bla AND subject:OK AND received:today AND from:"xyz@domain.com"

Why this is no robust solution?

@Yameso You can see different results because Get Exchange Mail Messages has this filtering capabilities Perform an AQS search by using EWS in Exchange | Microsoft Docs while Get Outlook Mail Messages support other filtering JET Queries or DASL Queries.

Also, the received date in case of Exchange refers to the server date while received date in case of Outlook refers to client side date.

I used:

subject:(Bla bla bla AND OK) AND received:today AND from:"xyz@domain.com"

because I read that condition for one property (as subject) can be written with brackets. It worked time to time. So finally I changed my workflow and i used only one filter:

received:today

and just after that I checks those email with for each activity. But I dont like this solution - it’s simplified and not as efficient as filtering could be.

So I dont know if it’s my bad filtering or there is sth wrong with filter property - it works strange with more then one logical condition.