nnet
August 16, 2019, 12:11am
1
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
nnet
August 17, 2019, 2:09pm
2
Can anyone provide some insight, thanks!
Badger
August 17, 2019, 2:23pm
3
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.
nnet
August 17, 2019, 4:27pm
4
@Badger thanks for the explanation...your example [tags][0] == "blah" { ... }
would test for the first element in the array if I understand correctly.
Thanks!
system
(system)
Closed
September 14, 2019, 4:28pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.