sqloutlookschemauipathurn

URN Filter to Ignore Emails


I am using UiPath's Get Outlook Mail Messages component to obtain emails. My only request has been to ignore any emails that are Replies, so contain "RE:"

In my email filters I had tried the below:

@SQL=urn:schemas:httpmail:subject NOT LIKE 'RE%'

Unfortunately, I receive the error "Get Outlook Mail Messages: Cannot parse condition. Error at "@SQL=((urn:schemas:httpmail:subject NOT ...".

When I try the filter: `

@SQL=urn:schemas:httpmail:subject LIKE 'RE%'

I am able to obtain all emails that contain 'RE:' but as specified, I want to omit these.

Would anyone be able to advise how to Omit these emails? I need to obtain every other email in the Inbox so makes more sense to just ignore the Replies. Thanks,


Solution

  • Your code is very close to being correct. The NOT keyword does work, just the placement is incorrect, unlike normal SQL where the NOT would be before the LIKE, in this case it would come before the field name.

    So rather than:

    @SQL=urn:schemas:httpmail:subject NOT LIKE 'RE%'
    

    It would be:

    @SQL=NOT urn:schemas:httpmail:subject LIKE 'RE%'