I need to add a filter in the Get Outlook Mail Messages activity where it filters a specific sender email and a particular text contains in the subject. I have tried something like below but it does not work.
“@SQL=”“urn:schemas:httpmail:subject”" like ‘%my text%’ AND [SenderEmailAddress]=‘test@gmail.com’"
Note - I know we can do this by reading the whole mailbox and checking each email’s sender and subject in a loop with an IF. But I am looking for a better option as mentioned above if possible.
The 1st one gives the below error.
“[SenderEmailAddress] = ‘test@gmail.com’ AND [Subject] LIKE ‘%test text%’”
Condition is not valid
The 2nd one gives the below error.
“@SQL=(”“urn:schemas:httpmail:subject”" like ‘%test text%’) AND ([SenderEmailAddress] = ‘test@gmail.com’)"
Cannot parse condition. Error at “@SQL=(((“urn:schemas:httpmail:subject” l…”.
I think the second condition for the email sender address needs to be corrected in your query. But I got your point regarding the dasl and tried it below.
“@SQL=”“urn:schemas:httpmail:fromemail”" = ‘test@gmail.com’ AND ““urn:schemas:httpmail:subject”” LIKE ‘%test text%’"
Now there is no exception. But it does not return anything when there are emails that exist.