Support

Account

Home Forums Front-end Issues The logic behind conditional logic :)

Solved

The logic behind conditional logic :)

  • When I only have 1 AND condition like this it works perfectly:

    data-conditions="[[{"field":"field_5ed4178dd63d7","operator":"!=","value":"20200701"},{"field":"field_5ed4181bd63dc","operator":"==","value":"1"}]]"

    But when I do the same trick again and add an OR like this it doesn’t work anymore:

    data-conditions="[[{"field":"field_5ed4178dd63d7","operator":"!=","value":"20200701"},{"field":"field_5ed4181bd63dc","operator":"==","value":"1"}],[{"field":"field_5ed4178dd63d7","operator":"!=","value":"20200702"},{"field":"field_5ed4181bd63dc","operator":"==","value":"1"}]]"

    I believe this is the correct way to add an OR statement right?

    I need to have like this:

    Contition X AND Y…… OR condition A AND B…. OR…. and so on.

    So love this stuff 🙂

  • I think it has to do with the logic

    
    if
      field 1 does not equal XXX AND field 2 == 1
    OR
      field 1 does not equal YYY AND field 2 == 1
    

    if field 1 equals YYY then the first statement is true. If field 1 equals XXX then statement 2 is true. The field will always be shown.

    if yo want this field to be hidden for any of the possible values in field 1 then what you need is

    
    if field 1 != XXX AND field 1 != YYY AND field 2  == 1
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.