Filter email by subject with certain keyword and received date

Hi all, I am trying to filter my email by a specific keyword in the subject and by the date received today or D-1 . I try this filter express but i got an error message of " Get Outlook Mail Messages: Cannot parse condition. Error at"“@SQL=“urn:schemas:httpmail:subject” like…”.

“@SQL=”“urn:schemas:httpmail:subject”" like 'VDM’ AND [ReceivedTime] >= ’ " + now.AddDays(-1).ToShortDateString + " ’ "

Can someone help to see what wrong with my filter expression ?

"@SQL=urn:schemas:httpmail:datereceived>='" +now.AddDays(-1).ToShortDateString+ "'AND (urn:schemas:httpmail:subject like ‘%XYZ%’)"

Tried but not working

What is the error are you getting. can you share the screenshot

image
The same error

Hi @xiangyun.koh

Try this

"@SQL=""urn:schemas:httpmail:subject"" like '%VDM%' AND [ReceivedTime] >= '" + Now.AddDays(-1).ToString("yyyy-MM-dd") + "'"

Regards,

@xiangyun.koh - I read the documentation.

Activities - Get Outlook Mail Messages (uipath.com)

Combining the two marked in the screenshot gives you something like this.

“@SQL=”“urn:schemas:httpmail:subject”" like ‘%VDM%’ AND [Received] >= ‘" + DateTime.Today.ToString(“d”) + " 00:00AM’"

Maybe it helps.

@xiangyun.koh,

Try this filter "@SQL=""urn:schemas:httpmail:textdescription"" like '%VDM%' AND [ReceivedTime] >= '" + DateTime.Today.ToString("d") + " 00:00AM' OR "[Received] >= '" + DateTime.Today.AddDays(-1).ToString("d") + " 00:00AM' AND [Received] < '"+ DateTime.Today.ToString("d") + " 00:00AM'""

Thanks,
Ashok :slight_smile:

Hi i tried this but i still get the same error :
Get Outlook Mail Messages: Cannot parse condition. Error at “@SQL=“urn:schemas:httpmail:subject” like…”.