Filter mail (outlook)

I want filter mail outlook.
I have value SenderEmail = ‘xyz@xyz.com
value Subject = Report

If I wanvalue t use filter in Get outlook mail messages.
How to code it?

Condition Filter mail that SenderEmail same value SenderEmail and SubjectMail contain Subject.

Please guide me about it.

@fairymemay

You may check below documentation

Hope this may help you

Thanks

1 Like

@Srini84 Yes.
But I don’t know how to pass variable in Filter Expression.

@fairymemay

Try below expression in Filter field.

  1. Filter mails from specific sender.

            "[SenderEmailAddress] = '"+varEmail+"'"
    
  2. Filter mails based on specific subject.

             "[Subject] = '"+varSubject+"'"
    

Here varEmail and varSubject variables are of type String.

1 Like

You can use a for loop and an if condition using filter straight in the get outlook activity cant include conditions like contains ,starts with etc

so better to take the output of get mail activity and loop the activity with type argument as System.Net.Mail.MailMessage

1 Like

@lakshman error as below.

image

@fairymemay

It should be like below.

       "[SenderEmailAddress] = '"+fromEmail_Round1+"' AND [Subject] = '"+mailSubject_Round1+"'"
2 Likes

Hi @fairymemay
please find the below sample
Main.xaml (6.3 KB)
Thanks

1 Like

Hi @fairymemay

Further to @lakshman’s post.

Check out the screenshot below:

For the full list of filter examples check out the documentation here.

Cheers

Steve.

1 Like

@nikhil.girish If I want use variable mailSubject_Round1 replace Report.

How to edit code?

image

Hi @fairymemay

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

Thanks

2 Likes

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