Combining AND and OR in Rules I'm trying to set up a rule (using the Rules module) with AND and OR conditions.
I have a content type with a field A (date) and field B (time slot).

The rule needs to check if field A is either e.g. a Monday or a Wednesday AND if the time slot in field B is either 16:00 or 17:00 or 18:00 or 19:00 (on a Monday) OR 13:00 or 14:00 or 15:00 or 16:00 (on a Wednesday).

If it meets those criteria it has to perform an action.

I've set up my rule as shown in the screenshot, but alas whatever combination or indentation I use, it won't work ...

Who can shed some light on this? Much appreciated.
You need 2 extra ANDs, right below the highest level (1st) OR.

And EACH of the 2 ORs you already have, and the Data comparison that preceeds those ORs, you need to move them below the extra AND. So that in the end it looks like so:


OR

AND



Data Comparison (A=Maandag)




OR





Text Comparison (B=16:00)






Text Comparison (B=17:00)






Text Comparison (B=18:00)






Text Comparison (B=19:00)




AND



Data Comparison (A=Woensdag)




OR





Text Comparison (B=13:00)






Text Comparison (B=14:00)






Text Comparison (B=15:00)






Text Comparison (B=16:00)





Here is how "I" would translate the above logic:


We accept a date that is either on Monday (line 2 to 8) OR (line 1) Wednesday  (line 9 to 15).
If you want a date that is a Monday (= line 3), we insist (via the AND in line 2) that you pick a timeslot that fits for us on Monday.
To pick a timeslot for Monday, you have a choice (OR in line 4) of 4 options (ie those in line 5, 6, 7 or 8).
Similar Rules, oeps rules, apply for Wednesday, as expressed in line 9 to 15.


If after these changes your Rules Action(s) still don't get executed (because something else is wrong in any of these Rules Conditions, and/or you're not using an appropriate Rules Event), then move on to Rules debugging, as explained in "How can I display the value of a variable inside a condition?".

PS: just to make sure your "Text Comparison" condition behaves as you expect/hope it to do, create a temporary clone of your rule with only 1 Rules Condition (= 1 such text comparison), with same Rules Event and same Rules Action. That way you can either narrow down your problem, or exclude that as a possible reason why it still doesn't work.