Filter gmail emails with multiple conditions

Hello Colleagues, I am obtaining gmail emails with the Get IMAP activity, but I need to obtain only the emails that are unread from the last 6 days and that contain the words Teorico o TEORICO, o teorico, o teórico
How can I do it with FilterExpression?

Hi @Juan_Esteban_Valencia

Try this filter expression:

"UNSEEN AND SINCE ""'"+Now.AddDays(-6).ToString("dd-MMM-yyyy")+"'" AND (SUBJECT ""Teorico"" OR SUBJECT ""TEORICO"" OR SUBJECT ""teorico"" OR SUBJECT ""teórico"" OR BODY ""Teorico"" OR BODY ""TEORICO"" OR BODY ""teorico"" OR BODY ""teórico"")"

Hope it helps!!

@Parvathy
Thanks, but I’m getting the following error
Get IMAP - Change Matter: The IMAP server responded to the ‘SEARCH’ command with a ‘BAD’ response: Could not parse command

Hi @Juan_Esteban_Valencia ,
You can try this step

  1. use Get IMAP activity to get list mail
  2. for each in list mail with If inside loop,
    if sender contain…
    regards,

Hi @Juan_Esteban_Valencia

It is because of the date format. Give the date format as per system format.

Regards

Hi @Juan_Esteban_Valencia

In the Get IMAP Activity set the unreadmessages to true

Try the following expression

For Each email In listOfEmails
If (Now - email.Headers(“Date”)).TotalDays <= 6 AndAlso (email.Subject.ToLower.Contains(“teorico”) Or email.Body.ToLower.Contains(“teorico”)) Then
’ Process email
End If
Next