Give variable in Outlook Subject Filter

Dear Forum Members,

I am using outlook filter function.

I am filtering mails based on subject, but my subject line is saved in variable.

When i try to give variable in filter property, it is not reading emails.

i am using : “[Subject]=’”+variable+"’".

Can anyone help where i am wrong, as hardcoded values are working properly but variables are not.

Regards,
Sahil

Hi @Sahil_Garg1

“[Subject]="’"+variable+"’"+"""

Can u try like this

Regards,

Nived N

Happy Automation

1 Like

Hi Nived,

It is giving error like , end of expression expected.

Hi @Sahil_Garg1
Try like this
“[Subject]=”+"’"+variable+"’"+Chr(34)

Regards,

Nived N
Happy Automation

1 Like

It is not working same like my expression , giving emails count = 0

Sample mail are present

Use SQL Expression like below

"@SQL=urn:schemas:httpmail:subject LIKE ‘%"+variable+"%’"

"@SQL=urn:schemas:httpmail:subject = ‘"+variable+"’"

image

Copy paste and remove and re enter single(’) and double("") quotes for safety…

1 Like

Hi ,

I think your expression is for checking Contains.

I want only equal part becoz same subject can be there in other emails.

Just remove % symbol then it will look for exact subject…

Actually, after removing % it will look for Starts with.

As i said same subject can be there for other email.

Meanwhile, expression is giving error , saying can’t parse emails

I don’t get your point…
Then what difference it will make with equals?
It will also look for same subject starts with and ends with…

Elaborate problem with example…

I have updated my first comment if you don’t wanna go with like operator…

Mate your previous expression is helping me to meet the requirements.

Thanks for your help

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