For filtering emails with specific subject, we can add the SQL string in Filter property of GetIOutlookMessages activity.
“@SQL=” & Chr(34) _ & “urn:schemas:httpmail:subject” & Chr(34) _ & " ci_phrasematch ‘question’"’
In get outlook message activity if you filter the mail messages based on received time or priority you can save the mail using save mail activity and the mails will be sorted.
or is it like you have stored your emails already in a particular location and you want to sort them.
My requirement is :
I have 10 unread email in my mail box.
I want to read the oldest email(only 1 mail); mark it as read and do some processing.
On the next execution, it will read the next oldest email and mark it as read and do some processing.
So in order to do this, I will be using GetOutlookMailMessage activity.
By default GetOutlookMailMessage reads the last recieved mail only(I want to change this behaviour to 'Read first received mail).
I want to specify the filter as : Sort the mails by ReceivedDate and priority.
You can Read only Top 10 Unread Mail Messages By settin Top property to 10 and check OnlyUnreadMessages Property to Check and MarkAsRead as well.
then you can use mailmsgs.OrderBy(function(p) p.Priority).OrderBy(Function(m) m.Headers("date")) with For each Activity to process your items one by one.
Yes we can sort it with a seperate fucntion ( mailmsgs.OrderBy(function§ p.Priority).OrderBy(Function(m) m.Headers(“date”))).
I was asking if we can do it using this SQL string : ’ “@SQL=” & Chr(34) _ & “urn:schemas:httpmail:subject” & Chr(34) _ & " ci_phrasematch ‘question’"’
which we use for subject filtering.
(Note : During one execution of the workflow, only one mail should be processed.)