Hi Everyone,
My requirement is I need to add 3 filters in get outlook mail message activity
based on subject name eg: Generated Reports
2.based on from address eg: xyz@gmail.com
3.based on date i.e., 20th of that month eg: 20th of may
please let me know your suggestions
Thanks in advance
Hello @kavya.s16 ,
Refer to the below post. It will solve your issue.
Hey everyone,
I checked almost every topic regarding this question and still couldnt find a proper answer
I want to use 2 filters in my get outlook mail message activity, I have tried couple of ways but couldnt manage to work.
tried:
“[Subject]=‘test’ And [Received] >= " + DateTime.Today.ToString(“d”)”
and couple more but this is the latest one I tried.
What I need is to get mails with the subject, lets say ‘test’ and mails that recieved at the current day.
so filters are, s…
instead of today if i need to search for a particulart date how can i do it?
@Rahul_Unnikrishnan
@Palaniyappan could u pls help
Hello @kavya.s16 ,
You can try as below. This will help to filter the email based on date and time.
**CDate(item.Headers(“Date”)) >= Datetime.ParseExact((“05/06/2022 00:00:00”).ToString.SubString(0,10),”MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture) **
AND
CDate(item.Headers(“Date”)) <= Datetime.ParseExact((“05/26/2022 24:00:00”).ToString.SubString(0,10),”MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture)
I tried using this to filter outlook mails
“@SQL=urn:schemas:httpmail:subject like ‘%SV%’ AND urn:schemas:httpmail:from=‘xxxxx@xxxxx.com’”
but the from email address doesn’t seem working , i have to apply 3 filters 1.subject 2.from address 3 date 20 th of current month
@Rahul_Unnikrishnan @Palaniyappan any solution for this ?
try this @kavya.s16
"[Subject] = 'Generated Reports' AND [SenderEmailAddress] = 'xyz@gmail.com' AND [Received] >= '" + Now.toString("20/MM/yyyy") + " 00:00AM' AND [Received] < '" + Now.toString("21/MM/yyyy") + " 00:00AM'"
Hi @jack.chan i cant use the [subject] for subject bcoz subject line might vary eg : FW : Generate reports then it wont work
then try this please @kavya.s16
"@SQL=urn:schemas:httpmail:subject like '%Generated Reports%' AND urn:schemas:httpmail:fromemail = 'xyz@gmail.com' AND urn:schemas:httpmail:datereceived >= '" + Now.ToUniversalTime.toString("20/MM/yyyy 00:00:00") + "' AND urn:schemas:httpmail:datereceived < '" + Now.ToUniversalTime.toString("20/MM/yyyy 00:00:00") + "'"
1 Like
@jack.chan how to use variable instead of generated reports in the subject and that from address part is not working
jack.chan
(Jack Chan)
May 19, 2022, 3:13pm
10
"@SQL=urn:schemas:httpmail:subject like '%"+variableSubject+"%' AND urn:schemas:httpmail:fromemail = '"+variableEmail+"' AND urn:schemas:httpmail:datereceived >= '" + Now.ToUniversalTime.toString("20/MM/yyyy 00:00:00") + "' AND urn:schemas:httpmail:datereceived < '" + Now.ToUniversalTime.toString("20/MM/yyyy 00:00:00") + "'"
kavya.s16
(Kavya S16)
May 19, 2022, 4:45pm
11
@jack.chan fromemail is not working and date part is working only if first part is used but mails from 20th is also read
“@SQL=urn:schemas:httpmail:datereceived >= '” + Now.ToUniversalTime.toString(“MM/19/yyyy 00:00:00”) + “'”