How to get IMAP mail messages filtering mail subject using variables?

Hi,

I have this scenario where I am trying to retrieve mail message using GET IMAP MAIL MESSAGE activity and in the filters, I am using filter for the subject with multiple variables (str_City and str_Email) with “OR” operator. But I am unable to get the desired result, requesting the community members to help me out.

Thank you.

Hi @RPA_U
welcome to the community

can you try this way

or explain what you want to filter

@RPA_U

Welcome to the community

Try this

"OR (SUBJECT """ + str_State + """) (SUBJECT """ + str_City + """)"

Cheers

Hi Shiva,

Thank you for the response but this is not what I am trying.

I am trying to use filter in the Get IMAP mail message activity itself so that the activity only retrieves mail if it matches either CITY or EMAIL which will be mentioned in the subject.

@RPA_U

Can please share the filter condition which you have mentioned in the filter properties

Hi Anil,

Thank you for the response. I tried your suggestion but it did not work, I received an error

Get IMAP Mail Messages: The IMAP server replied to the ‘SEARCH’ command with a ‘NO’ response: infeasible query (Failure)

image

Sure,

Condition: “OR (SUBJECT “”” + str_Email + “”“) (SUBJECT “”” + str_City + “”“)”

image

Hi @RPA_U
“@SQL=urn:schemas:httpmail:subject LIKE '%”+str_Filter+“%'” → strFilter is your variable
Please try this

@RPA_U

Can you please check the variables your are passing and the subject is in the correct format

“OR (SUBJECT '” + str_Email + “') (SUBJECT '” + str_City + “')”

Hi Shiva,

I received the same error as mentioned in the reply to Anil.