It doesn’t have to use arrays unless your colour and size data is inside arrays. If you have size and color set in text values, here is what could would work in the filter.
Let us set up an expression with an if()
that evaluates to true
if it passes the conditions, and false
otherwise. Then in the filter condition I use the Boolean operator ‘equal to’ to check whether the expression is true
to pass through the filter. If the if()
expression evaluates to false it will fail and not pass through.
You can just adjust the if()
expression to add more colours and sizes and even other conditions, being careful to ensure the boolean expression is logically correct to what you actually want to evaluate.
Here’s the expression
{{if((1.size = "L" | 1.size = "XL" | 1.size = "2XL") & (1.color != "red" & 1.color != "gray"); true; false)}}
You can copy and paste this right into the condition. Just make sure the color coding comes out ok because the operators must evaluate correctly. Don’t just type the value true but use the pink pill to enter it.
Note the use of the ()
to create the evaluation precedence between the and
phrase. These operators are available on the gear tab of the variable/expression picker:
I setup a simple scenario to help you test the expression by setting 2 variables for color and size in the first module and then an increment module and put the filter between them to see if it passes/fails depending on the input values I can easily set in the first module.
blueprint (24).json (4.7 KB)