If expression confusion

Hi, in trying to create an conditional if expression, I started with:

if [tags] == "blah" or [tags] == "blah2" or [tags] == "blah3" { blah }

but event data wasn't being "caught" by this expression.
I then changed the expression to:

if "blah" in [tags] or "blah2" in [tags] or "blah3" in [tags] { blah }

I have filters where I use expressions having if [tags] == "blah" { blah } that work.

Why does the first expression fail but the second one works?

Thanks

Can anyone provide some insight, thanks!

tags is an array that may contain more than one member, so testing for array membership using "in" is the right way to do this.

if [tags][0] == "blah" { ... }

will also work.

@Badger thanks for the explanation...your example [tags][0] == "blah" { ... } would test for the first element in the array if I understand correctly.

Thanks!

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