DASL Outlook filter for date

Hello,

I’m trying to use DASL query to get subject and sent date to verify that the email was sent, i.e. is in the outlook ‘Sent Items’ folder.

I’m using the Get Outlook Mail Message activity, as follows:
image

My query in the filter is as follows, where I am trying to get an email from
"@SQL=(""http://schemas.microsoft.com/mapi/proptag/0x0037001f"" like '%PLATO FILE MOVE REQUEST%') AND (""http://schemas.microsoft.com/mapi/proptag/0x0E060040""> 'system.DateTime.Now.AddMinutes(-500)')"

system.DateTime.Today is output as 08/15/2019 07:21:19 so that’s ok, as I want to find emails since this morning, let’s say.

It seems to pick up the correct email sent today, however if I change the minutes to -60 to find within the last hour, when I know there won’t be any emails to pick up, the process returns the same email. I was hoping it wouldn’t return anything and have EmailList blank.

If I hard-code the date where no email was sent as 2019-08-15 15:00:00, it returns a log message ‘No Email Found’ which is what I want.
"@SQL=(""http://schemas.microsoft.com/mapi/proptag/0x0037001f"" like '%PLATO FILE MOVE REQUEST%') AND (""http://schemas.microsoft.com/mapi/proptag/0x0E060040""> '2019-08-15 15:00:00')"
image

I would be grateful for any suggestions on how to make it work without hardcoding the date.
byuli

Hi @byuli

Check this

Get Outlook Mail Messages Filter Filter By Subject

Thanks
Ashwin.S

:smiley: thanks I guess… It’s not what I was after though. The issue is the date, not the subject.

Use as system.datetime.tostring come with am and pm
Thanks
Ashwin.S

Hi,

Did you get any answer for this, I’m also facing the same issue. I have to pick the mails for every x minutes

Regards,
AK

1 Like