I have queries for Filter Option in Get Outlook Mail Messages. I have gone through all of topic which is covered on forum, but non of them seems to be valid in my case.
I need to filter email for last 5 Hours Email from now. I have used all the possible solution in forum topic but does not seem to be working fine.
I have tried below Filters. None of them giving runtime and compile time error but, output count is always coming as 0. I am here to get some solution to it.
1 : “[ReceivedTime] > '”+now.AddHours(-5).toString(“D”)+”'" – working but not giving last 5 hours email
2: “[ReceivedTime] >'”+Now.AddHours(-5).ToString()+“'” –Not Working - Email Count = 0
3: “[ReceivedTime] >'”&Now.AddHours(-5).ToString()&“'” – Not Working - Email Count = 0
Along with this - one more question like is not accepted by [Subject] Filter ? “[Subject] like ‘’%Test%” – Not working
Q: How to get received time of email, after using for each Item. There is no property to get received date. (like item.?)
S O L U T I O N
Please check the last comment of mine for all possible Solutions. I have put every solution at one place. Thank You!
Note: subjectString is just a string variable e.g. e.g if subjectString = “UIPATH” it will filter by all subjects that contain “UIPATH”
Example:
if subjectString = “UIPATH”, then filterString will look like @SQL=urn:schemas:httpmail:subject Like '%UIPATH%' AND urn:schemas:httpmail:datereceived > '23/12/2020 01:43:00'
If this doesnt work then it might be something to do with your date format. Mine is dd/MM/yyyy but it might be MM/dd/yyyy for you…
its LINQ syntax, it works because listOfEmails is a list, and linq works with lists / datatables etc…
As for using search in filter, im not sure why its not working for you. Probably due to outlook timezone difference as you said. Maybe you have to convert the timezone of the date in your filter first.
But if my above method is working i think you can stick to that for now
@loginerror@vvaidya@Palaniyappan
Hello All,
As per my requirement I need to capture last 5 hours emails. This can be achieved by Linq and Iterator after capturing all the emails. But I want to use Filter Option to it. I tried following ways in Filter and none of them working. Could you please suggest what could be the reason?
Looks Like It is working as expected after converting this to Universal time. Our assumption of issue with time zone was right. Something New Learning.
Thanks @jack.chan for all your efforts/help to get this worked. Because of the issue we have now three different way to filter.