Logical Operators: AND, OR & NOT

The fun really begins when you start to combine rules and rulesets using logical operators. The ability to do this without any restrictions – yet in a user-friendly way without any need for coding – is a key point of difference for the Rulestar platform.

 

Google's demonstration

The 3 logical operators AND, OR and NOT are neatly demonstrated in the following animated logo that Google released to celebrate Boolean logic. The 2 black circles will contain either x, y, both x and y or neither of them, and each of the other letters in the logo will de displayed in color depending upon whether the logical rule shown below it validates as true.

 

"AND" Logical Operator

When the AND logical operator is used to join multiple rules and/or rulesets, that test will validate as true only if all of rules and rulesets within it validate as true.

In the example image below, "AND" is being used to join 3 checkbox rules to test for the scenario in which all of the options in that checkbox field have been selected:

 

You can learn more about the "contains" operator here.

 

"OR" Logical Operator

When the OR logical operator is used to join multiple rules and/or rulesets, that test will validate as true if any of rules or rulesets within it validates as true.

 

In the example image above, "OR" is being used to join 2 checkbox rules to test for the scenario in which any of the options from the blue box have been selected or any of the options from the orange box have been selected. In that example case, both of those paths lead to the same outcome. You can see that in context by following our Tutorial Series, which is highly recommended.

 

"NOT" Logical Operator

When the NOT logical operator is wrapped around a rule or ruleset, that test will validate as true if the test that it surrounds validates as false.

Typically, the NOT logical operator is applied around a group of multiple rules. This is because testing for the negative in a single question can be achieved using the "does not equal" and "does not contain" operators within the rule itself.

NOTE: The != symbol is shorthand for "does not equal".