I am trying to get email from previous day. I am current using this filter - “receivedDateTime eq ‘”+ now.AddDays(-1).Tostring +“’”
But Its giving me this error
Thanks in Advance
I am trying to get email from previous day. I am current using this filter - “receivedDateTime eq ‘”+ now.AddDays(-1).Tostring +“’”
But Its giving me this error
Thanks in Advance
try this
"ReceivedDateTime ge "+now.AddDays(-1).Tostring+" and ReceivedDateTime lt "+now.Tostring
Hi,
How about the following?
"receivedDateTime ge "+ now.AddDays(-1).Tostring("yyyy-MM-dd") +" and receivedDateTime lt "+now.Tostring("yyyy-MM-dd")
Regards,
It doesn’t seems to be working.
Email received time - [10/11/2022 22:39:35]
I tried - "receivedDateTime ge “+ now.AddDays(-1).Tostring(“MM/dd/yyyy hh:mm:ss”) +” and receivedDateTime lt "+now.Tostring(“MM/dd/yyyy hh:mm:ss”)
getting this error
Hi Jack,
It didn’t worked
It doesn’t seems to be working.
Email received time - [10/11/2022 22:39:35]
I tried - "receivedDateTime ge “+ now.AddDays(-1).Tostring(“MM/dd/yyyy hh:mm:ss”) +” and receivedDateTime lt "+now.Tostring(“MM/dd/yyyy hh:mm:ss”)
getting this error
Hi,
My expression is
"receivedDateTime ge "+ now.AddDays(-1).Tostring("yyyy-MM-dd") +" and receivedDateTime lt "+now.Tostring("yyyy-MM-dd")
Did you try this?
Regards,
ya but it’s not picking up any email
Hi,
The filter syntax seems correct because of no error.
How about the following?
"receivedDateTime ge "+ Today.AddDays(-1).Tostring("yyyy-MM-ddTHH:mm:ss") +" and receivedDateTime lt "+Today.Tostring("yyyy-MM-ddTHH:mm:ss")
Or try to change -1 to -7 ,for example, in AddDays if can get some mail?
Regards,
This worked by changing to -2 days.
The issue now is my outlook shows I recevied the email on -
But Uipath shows - [10/12/2022 15:18:35]
I think I need to find a way to filter out email from last day. Might loop through email list.
Hi,
It might be timezone matter. If we need to convert localtime to UTC, the following might work. Can you try this?
"receivedDateTime ge "+ System.TimeZoneInfo.ConvertTimeToUtc(Today.AddDays(-1)).Tostring("yyyy-MM-ddTHH:mm:ss") +" and receivedDateTime lt "+System.TimeZoneInfo.ConvertTimeToUtc(Today).Tostring("yyyy-MM-ddTHH:mm:ss")
Regards,
The filter works but it’s still missing out on some email that recevied yesterday early in the morning( because of 10 hour issue)
. So I decided to use this - "receivedDateTime ge “+ now.AddDays(-2).Tostring(“yyyy-MM-dd”) +” and receivedDateTime lt "+now.Tostring(“yyyy-MM-dd”)
to get email from the last 2 days and then for each loop I added 10 hours to received date and use this If condition
Which giving the outcome I am after