Difficult filtering emails when we have ’ symbol in the subject

Hi all,

I can filter outlook mails with the help of the subject by using the below command.
“@SQL=(”“urn:schemas:mailheader:subject”“like '”+in_JobSearchQuery.ToString+“')”

but we are getting issues when we have ’ symbol in the subject.

input - Test Engineer - Web Services | Immediate Joiner’s, Testing Engineer
Error - Get Outlook jobseeker Mail : Cannot parse condition. Error at “@SQL=(“urn:schemas:mailheader:subject”= …”.

Due to symbol [ apostrophe OR single quote] within-subject getting error.
Anyone have an idea how to handle that symbol in outlook filtering

1 Like

Did you find a solution to your problem? As I am facing same issue with ’ in the subject line gives a parsing error for outlook email filters.

Hi Prasanna and Aditi,

The outlook filter is using SQL schema so the following approach should work:
“@SQL=(”“urn:schemas:mailheader:subject”“like ‘”+in_JobSearchQuery.ToString.replace("’“,”‘’“)+”’)"

Note: replacing a single apostrophe with two apostrophe.

Hope this helps.