Outlook Filter Option doesn't seem to work

Dear All

I tried to pick up emails which I received within the last 2 minutes ONLY.

Filled below in Get Outlook Mail Messages activity Filter option.

“@SQL= urn:schemas:httpmail:datereceived > '”+ Now.AddSeconds(-120).ToString(“dd/MM/yyyy hh:mm:ss tt”) +“'”

However, there are no emails found in Outlook always,
whereas some of emails had been received 1 min before this Workflow ran.

Appreciated if anyone can advise me what’s wrong with this.
Thank you in advance!

1 Like

Hey @u2018dem0528

Could you please try the below,

"[ReceivedTime] >= '" + DateTime.Now.AddMinutes(-2).ToString("MM/dd/yyyy HH:mm tt") + "'"

Hope this helps.


Thank you for replying. However, I was thinking to combine with “@SQL= urn:schemas:httpmail:subject like '%” + EmailSubject + “%'”
(This subject search worked correctly, whereas datereceived didn’t work. )

If “@SQL = urn:schemas:httpmail:datereceived …” doesn’t work well then, I will separately just apply “[ReceivedTime]” filter and use If activity to check subject without combining two filters into filter option field.

1 Like

You can use the same way for Subject !

Please let me know if it’s still not working.

Thanks again. Once combined two criteria, suddenly it doesn’t work as intended. datereceived always give back zero results, whilst there’s one email to be picked up.

I separated two conditions and used If activity as above-mentioned eventually…

You means it’s working now could you please show the condition what you have used !