I’ve used several different methods of filtering for a specific date with the Get Outlook Messages activity, but none of them seem to be filtering correctly. It’s returning the incorrect number of emails. I don’t know if I’m experiencing limitations of UiPath or if there are inherent limitations due to time zones.
For example, I’ve tried filtering for the date two days ago. Here are a couple of methods I’ve tried:
"[ReceivedTime]>= ’ " + now.AddDays(-2).ToString(“D”) + " ’ AND [ReceivedTime]<= ’ " + now.AddDays(-1).ToString(“D”) + " ’ "
"[ReceivedTime]>= ’ " + now.AddDays(-2).ToString(“MM/dd/yyyy”) + " ’ AND [ReceivedTime]<= ’ " + now.AddDays(-1).ToString(“MM/dd/yyyy”) + " ’ "
I’ve also tried to adjust the -2 and -1 in now.AddDays() in case UiPath can recognize fractions of days:
"[ReceivedTime]>= ’ " + now.AddDays(-2.5).ToString(“MM/dd/yyyy”) + " ’ AND [ReceivedTime]<= ’ " + now.AddDays(-1.5).ToString(“MM/dd/yyyy”) + " ’ "
I’ve also tried using the specific date-time:
"[ReceivedTime] >= ‘11/27/2018’ AND [ReceivedTime] <= ‘11/27/2018 23:59:59’ "
It’s really strange because if I use a correct filter that has worked for others within these forums, the activity will return exactly 14 emails from the date prior to the day I’m trying to retrieve. Emails are continuously being sent to the email folder. So I don’t understand why it’s returning more emails than what was received during the specified day.