Urgent! I`m unable to filter outlook email by current dat

Expression used in outlook filter

“[ReceivedTime] >= '”+ Now.AddDays(-1).Date.ToShortDateString+ " ’ AND [ReceivedTime] <= '“+ Now.Date.ToShortDateString+” '"

It is giving count of email as 5.
But actually there areonly 2 emails
Please help asap.

Hi
welcome to UiPath community
the expression looks correct
but we need to check with the property panel of GET OUTLOOK MAIL ACTIVITY whether onlyunreadmail is check and if so it will fetch only them
or
we need to check with the mail whether it has five mails from yesterday to till date

Cheers @98d5b817dcd19244c50b

1 Like

[ReceivedTime] >=’ + Now.AddDays(-1).ToString(“MM/dd/yyyy”) + “’ AND [ReceivedTime] < '” + Now.Date.ToString(“MM/dd/yyyy”)+ “'”

try this and let us know if this helps.
Regards,
Pavan H

  1. onlyunreadmail is unchecked
    2.yesterday + today = 6 mails

Hey ,it is throwing end of expression error

@Palaniyappan

the expression you were using is fine
no changes in the expression we need to validate only the number of mails in outlook

@98d5b817dcd19244c50b

I get error now

1 Like

Fine
try with this expression
" [ReceivedTime] >= ’ " + Now.AddDays(-1).ToString(“MM/dd/yyyy”) + “ ’ AND [ReceivedTime] <= ’ ” + Now.Date.ToString(“MM/dd/yyyy”) + “ ’ ”

Cheers @98d5b817dcd19244c50b

tried this.
Today mail count is shown as 6 …actual is 4

Change either of this >= to <
" [ReceivedTime] > ’ " + Now.AddDays(-1).ToString(“MM/dd/yyyy”) + “ ’ AND [ReceivedTime] <= ’ ” + Now.Date.ToString(“MM/dd/yyyy”) + “ ’ ”

or <= to <
" [ReceivedTime] >= ’ " + Now.AddDays(-1).ToString(“MM/dd/yyyy”) + “ ’ AND [ReceivedTime] < ’ ” + Now.Date.ToString(“MM/dd/yyyy”) + “ ’ ”

try any of these and let know pls
Cheers @98d5b817dcd19244c50b

Giving wrong count for both

Hi
please try this one

“[ReceivedTime]>'”+now.AddDays(-1).ToString(“MM/dd/yyyy hh:mm tt”)+“'AND [ReceivedTime] <= ‘”+now.ToString(“MM/dd/yyyy hh:mm tt”) +“’”

and in Top property provide as int32.Maxvalue

Can I have a view on the get outlook mail activity property panel a screenshot
Is the folder mentioned is right
Because either of this expression
should work

Cheers @98d5b817dcd19244c50b

Hi @98d5b817dcd19244c50b,

In Filter box use the condition below -

“[ReceivedTime]>=‘YourCondition’”

For current system date-time use DateTime.Now.ToString(“YourDateTimeFormat”)

Thanks & Regards,
Apurba

Got error

You can use
“[ReceivedTime] >= '”+now.ToString(“MM/dd/yyyy”) +“'” this condition also
please try it