Get Outlook Mail Messages Filter Filter By Subject

I want to use the filter option on the Get Outlook Mail Messages activity. I am trying to get all emails that contain the subject “Billing”. What I currently have is “[Subject]=‘Billing’” but this does not return anything. What am I doing wrong? I do not want to use a for loop to iterate over emails unless I can mark the ones without Billing as unread.

Thank you

SOLUTION:

"@SQL=urn:schemas:httpmail:subject LIKE '%Your Item%'"
OR
"@SQL=""http://schemas.microsoft.com/mapi/proptag/0x1000001E"" like '%Your Item%'"

If you want to search for multiple items
"@SQL=urn:schemas:httpmail:subject like '%Your Item1%' or urn:schemas:httpmail:subject like '%Your Item2%'"

7 Likes

Hi
mention like this
@SQL=urn:schemas:httpmail:subject LIKE 'Billing’
For more info on this

Cheers @Jacob_Frost

2 Likes

When implementing your suggestion i get the following error:
Source: Get Outlook Mail Messages

Message: Cannot parse condition. Error at “@SQL=((urn:schemas:httpmail:subject LIKE…”.

Exception Type: System.Runtime.InteropServices.COMException

RemoteException wrapping System.Runtime.InteropServices.COMException: Cannot parse condition. Error at “@SQL=((urn:schemas:httpmail:subject LIKE…”.
at UiPath.Mail.Activities.GetMailActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

can i have a viw on the workflow a screenshot on where it is assigned if possible
Cheers @Jacob_Frost

sorry try with this, a typo mistake
@SQL=urn:schemas:httpmail:subject LIKE '%Billing%’
i tried from my end
its working fine
Kindly try this and let know for any queries or clarification
Cheers @Jacob_Frost

1 Like

I am still getting the same error as before. Is there a dependency that is necessary for this to work?

1 Like

hmm i wonder why it is not
can i have a screenshot of the error and the workflow with the changed statement
this can be solved
Cheers @Jacob_Frost

1 Like

kindly remove the account property and try once
The reason is i m trying to execute the same in my system, its working
Lets see
Cheers @Jacob_Frost

Is this what you meant? Still getting the same thing

1 Like

is that mail folder mentioned is correct
if inbox mention as "Inbox"
or if its testing and that testing is present as a subfolder inbox mention like this
"Inbox\Testing"

Cheers @Jacob_Frost

The testing folder is not a subfolder

I struggled with mine earlier this week, I think it’s the issue with double and single quotes. In the end my query for the Subject line is as follows:

"@SQL=""http://schemas.microsoft.com/mapi/proptag/0x0037001f"" like '%YOUR WILDCARD HERE%'"

9 Likes

That worked great! Thank you

There’s this as well with a different syntax, but I’m a complete rookie and didn’t manage to get it to work. It follows from what you were doing with urn:schemas:httpmail:subject

2 Likes

Thank you for the suggestion I got that working! I like this much better than the solution I initially got working
"@SQL=urn:schemas:httpmail:subject LIKE '%Your Item%'"

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.