<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00009mSK91SAGOkta Classic EngineUniversal DirectoryAnswered2026-04-01T09:00:20.000Z2020-10-27T18:17:45.000Z2020-10-29T18:05:28.000Z

ScottB.07094 (American Century Investments) asked a question.

Syntax for multiple Boolean conditions in a Group Rule

Hi all,

 

I'm trying to create a Group Rule that will add a user based on the following criteria:

 

((var1 == "Red") OR (var1 == "Blue")) AND ((var2 == "Dog") OR (var2 == "Cat"))

 

Using the syntax above, the statement is evaluating to false for a user I have verified is both "Blue" and "Dog". Both var1 and var2 are string type user.x variables.

 

Do I have a syntax issue or do I need to go about this a different way altogether? I'd like to avoid a complex string function if possible, but I'll go that route if I need to. I'm open to any suggestions you may have. Thanks!


  • k5fuw (k5fuw)

    I don't believe I've attempted that exact method, but here's an alternative way to do it.

     

    Arrays.contains({"Red", "Blue"}, var1) AND Arrays.contains({"Dog", "Cat"}, var2)

     

    Selected as Best
  • k5fuw (k5fuw)

    I don't believe I've attempted that exact method, but here's an alternative way to do it.

     

    Arrays.contains({"Red", "Blue"}, var1) AND Arrays.contains({"Dog", "Cat"}, var2)

     

    Selected as Best
    • ScottB.07094 (American Century Investments)

      I was able to use this condition and get it to evaluate properly. Thanks for the tip! The only change I had to make was changing var1 and var2 to user.var1 and user.var2 and it worked like a charm.

This question is closed.
Loading
Syntax for multiple Boolean conditions in a Group Rule