Get Outlook Mail Message - SQL DASL query advice

Hey community,

I’m trying to figure out two things with the Get Outlook Mail Message filter option.

I am trying to achieve to grab the first message that matches the following criteria:

  • The subject contains a particular phrase ex. ABC
  • The e-mail comes from someone from my company’s domain or from a particular e-mail address the client’s domain

Optionally:

  • I would also like to look for a particular e-mail address in the message body as the e-mail that i want to get is a forward
  • I would like the subject to match a pattern instead of just a substring, I would like something like subject is %ABC/%/% but it didn’t work. Is there a way to do it or my best bet is to iterate through messages and look for a regex match in subject?

Some of the filters I tried in the Outlook filter query builder and they did filter correctly in Outlook but Uipath just ignores it. Is there some gimmick or a mistake in the filter that I am not noticing?

An example filter I tried, some parentheses might be missing here, but in code it was supposedly okay because I wasn’t getting an exception, just the filter caught nothing. When I made smaller filters they seemed to worked but when I started combining them they won’t match any message.

“@SQL=(urn:schemas:httpmail:subject LIKE ‘%ABC%’ AND (urn:schemas:httpmail:fromemail LIKE ‘%@mycompany.xyz%’ OR urn:schemas:httpmail:fromemail LIKE ‘something@clientcompany.xyz’) AND (urn:schemas:httpmail:textdescription LIKE ‘%forwardedemail@forwardeddomain.xyz%’))”

Doubleposting because not sure if I can edit posts somehow - I think I’m having some broader issue right now, as I’m checking out the filters through the Outlook filter builder and I’m not even able to filter to get my own mail or mail from people from my org.

I’ve set the filter either to

“urn:schemas:httpmail:fromemail” LIKE ‘me@myorg.xyz’ - no matches for a mail I’ve sent to myself

“urn:schemas:httpmail:fromemail” LIKE ‘%myorg.xyz%’ - no matches for any mail from my org

If I do the same and put a client org in place of my own it doesn’t have issues.

1 Like