How to filter mails by specific keyword in mailBody?

Hi All,
I want to filter only those emails from Inbox which have the specific keyword in its mailBody. for e.g. only those emails which have Rajan in mailBody.
image

buddy @Sameer_Sen
once you get the mail with any of te activity like get outlook mail activity or get exchange mail activity, getting the output variable as out_mailmessages, a variable of collection type and using the for each loop , pass that variable out_mailmessages and change the type argument of for each loop as mailmessages,
inside the for each loop use a if condition to validate your mail with body that contains the text “Rajan”
like this, where item is the variable that we get from for each loop buddy @Sameer_Sen
item.Body.Contains(“Rajan”)
if this condition gets passed, it will go for THEN part of if condition or will go for ELSE part of if condition

thats all buddy you are done
Kindly try this and let know buddy whether this works or not
Cheers @Sameer_Sen

1 Like

@Sameer_Sen

Use below expression in filter property of Get Outlook Mail Message activity to filter mails where body contains Rajan word.

"@SQL=urn:schemas:httpmail:textdescription like ‘%Rajan%’"

@Palaniyappan It worked buddy… :smile:

1 Like

Fantastic buddy @Sameer_Sen
Cheers
Keep going

1 Like

@lakshman “@SQL=urn:schemas:httpmail:textdescription like ‘%Rajan%’” it was showing parse error, then I used below expression and it worked :slight_smile:

"@SQL=" + “”"" + “urn:schemas:httpmail:textdescription” + “”"" + " like ‘%Rajan%’"

1 Like

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