Email filtering 'end of expression expected'?

Hi there, sorry if this is a silly question, I’m new!

I am trying to filter emails by subject and if they have a flag on them. As far as I can work out, the following code should work, but I keep getting ‘end of expression expected’ error:

“@SQL=((urn:schemas:httpmail:subject like '%”+subject1+"%’ or
urn:schemas:httpmail:subject like ‘%"+subject2+"%’ or
urn:schemas:httpmail:subject like ‘%"+subject3+"%’ or
urn:schemas:httpmail:subject like ‘%"+subject4+"%’) and
urn:schemas:httpmail:messageflag IS NULL)"

Can anyone please explain why I might be getting this error? It has been bothing me for a long time! Thank you!

could it be the case that this string is used within an assign activity right hand side and is spanning over multiple lines?

I’m not sure I understand - this is input into the ‘get mail messages’ activity in the filter section of the properties.

please show us a screenshot from the implementation where we can see the entire string. thanks

This is the entire string?

but not a screenshot from your implementation done in uipath studio

The real subjects have company sensitive information and so I’m not going to screenshot. The string is written inside the ‘filter’ section of ‘get outlook mail messages’ activity and that is all.

we will stop the ping-pong by following:
grafik
has validation error
grafik
we can rewrite

Could you paste that here for me to try please?

we just ended the line by " + and did start the spanning line by a "
you can do it directly

I’m getting the same error :frowning:

ensure that form copy paste no " is replaced by “

"@SQL=((urn:schemas:httpmail:subject Like '%"+subject1+"%' Or " +
"urn:schemas:httpmail:subject Like '%"+subject2+"%' Or " +
"urn:schemas:httpmail:subject Like '%"+subject3+"%' Or " +
"urn:schemas:httpmail:subject Like '%"+subject4+"%') And " +
"urn:schemas:httpmail:messageflag Is NULL)"
1 Like

I appreciate your help with this, though I do seem to still be getting the same error and I’m unsure why :confused:

So, I tried the following and it didn’t instantly get an error in the filter box:

“@SQL=((urn:schemas:httpmail:subject Like ‘%subject1%’ Or
urn:schemas:httpmail:subject Like ‘%subject2%’ Or
urn:schemas:httpmail:subject Like ‘%subject3%’ Or
urn:schemas:httpmail:subject Like ‘%subject4%’) And
urn:schemas:httpmail:messageflag Is NULL)”

I am now getting a ‘parse error’ when I’m running it though…