How to filter outlook mail activity based on multiple parameters

Hi,

I want to filter outlook email activity based on subject, sender email and attachment name. All these values are coming from a variable and I am using below code to filter but its not working. Please help in this regard.

“@SQL=urn:schemas:httpmail:subject = '”+subjectTitle+“'” and “urn:schemas:httpmail:SenderEmailAddress = '”+sender+"’

@Palaniyappan

Can you try with fromemail instead of SenderEmailAddress? You can refer the below link on how multiple conditions can be used in DASL queries - UiPath Tutorial Day 72 : How to Filter Outlook Mail Message(DASL Query) Part 2 | Email Automation - YouTube

@rameezimtiaz

Instead of equals try with like…may be it contains some more characters as well

"@SQL=urn:schemas:httpmail:subject LIKE '%" + subject + "%'"

cheers

I have tried the following and got the attached error:

“@SQL=urn:schemas:httpmail:subject LIKE '%” + subjectTitle + “%’ and =urn:schemas:httpmail:SenderEmailAddress LIKE '%” + sender + “%'”

image

Can you make the expression for 2 variable and send?

I have tried the following way as well

“@SQL=urn:schemas:httpmail:subject LIKE '%”+subjectTitle+“%'” and “@SQL=urn:schemas:httpmail:SenderEmailAddress LIKE '%”+sender+“%'”

@rameezimtiaz

Please try this

"@SQL=urn:schemas:httpmail:subject LIKE '%"+subjectTitle+"%' AND @SQL=urn:schemas:httpmail:fromemail = '"+sender+"'"

Make sure email id is correct…i would suggest first try with hardcoded values to check and then use your variable

Cheers

Cheers

This worked

“[Subject] = '”+subjectTitle+“’ AND [SenderEmailAddress] = '”+sender+“'”

2 Likes

is there any way to add attachment name filter as well?

@Anil_G

@rameezimtiaz

On attachment name you cant directly apply filter …you have to loop through the mails and get it and filter accordingly…and there is correction if you want to use dasl query…what worked was a jet for you…you the correct one would be this

"@SQL=""urn:schemas:httpmail:subject"" LIKE '%"+subjectTitle+"%' AND @SQL=""urn:schemas:httpmail:fromemail"" = '"+sender+"'"

Happy coding

If at all you need detailed steps for name filter

Cheers

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