Outlook Mail Filter

Hello!

I’d appreciate if any one can help me with this
I need to filter the get outlook mail with the below:
Part of an email subject AND Sent Date

thanks in advance

@m0e91 Use “@SQL=urn:schemas:httpmail:subject like ‘%RPA%’” in filter property of Get Outlook mail message activity
Ref: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/cc513841(v=office.12)?redirectedfrom=MSDN

Few example of sent date sent:date
sent:this week –monday
sent:this week–today
sent:>11/1/06 Finds items sent after 11/1/06
sent:11/1/06…11/5/06 Finds items sent after 11/1/06 and before 11/5/06.

@Arpit_Kesharwani thanks for you reply!

can I merge between them, say for example, I need to search for mails with subject “RPA” that was sent on a specific date say 16.06.2020

is this possible?

Yes that is also possible
To build a filter using the Query Builder tab of the Filter dialog box, follow these steps:

  1. In Outlook, from the View menu, select Current View , and then select Customize Current View .
  2. In the View Summary dialog box, click Filter .
  3. In the Filter dialog box, click the Query Builder tab.
  4. Use the Query Builder interface to build your query. When you construct a filter, you actually build a WHERE clause without the WHERE keyword. Notice that you can use the logical AND or logical OR operator to develop the query and move clauses up or down.
  5. In the Filter dialog box, click the SQL tab shown in Figure 11-3 and clear the Edit These Criteria Directly check box. Once you clear the check box, you can copy the query by selecting it and pressing CTRL+C to copy it to the Clipboard.Figure 11-3. Copy a Filter string from the SQL tab of the Filter dialog box to construct a DASL query

images_cc513841.5c2b3c72-0779-419a-b647-a597ccde146c(en-us,office.12)

Hello!

image
image
I tried the filter for sent date any time, but is it not writing SQL for sent date.

and when I tried to copy this to the filter of the get outlook mail it gave an error

@m0e91 I am able to get the DASL query Note: If you will choose Anytime then it would not be added into the query
image
image

Then your Filter DASL query would be
“@SQL=((”“http://schemas.microsoft.com/mapi/proptag/0x0037001f”" LIKE ‘%Broadband%’ AND ““http://schemas.microsoft.com/mapi/proptag/0x0037001f”” LIKE ‘%Reimbursement%’) AND %last7days("“urn:schemas:httpmail:date”")%)"

1 Like

@m0e91 And also if you want any custom date then can filter from Advanced Tab
image

got it, but the thing iam trying to do is that I have an excel file having two fields like below, so the item colomn (ABC for example) is part of the subject, and the sent date of a certain mail.
so I need to write a code for filter get outlook mail like below
note that item and sent date will be variables inside the code
“@SQL=urn:schemas:httpmail:subject like ‘%+item+%’ AND the specific sent date variable inside the code"
I need to to write code to loop through rows and filter

image

1 Like

@m0e91 Yes you have to loop over the Excel file
For specific date please look into above answer

image

I tried to replace the same in get outlook mail filter, but its giving error.

@m0e91 use “@SQL=”“urn:schemas:httpmail:date”" = ‘18-06-2020 02:06’)" (Instead of " use “”)