• I have quite a large set of nested IFs and been trying to clean those up with a combination of ORs and ANDs. I know we can do stuff like field_2 value_2 compare_2. But I ran into an issue when I need to use a var and then an OR with a field. Neither field or field_2 seem to be doing what I’m expecting.

    [if var=time-delta compare_1=less value_1='1200' relation=or field_2=item_type value_2='3' compare_2=not]

    Also tried the first compare items without the number etc. Is this even supposed to work?

    • This topic was modified 3 years, 10 months ago by finnfin.
Viewing 3 replies - 1 through 3 (of 3 total)
  • This will not work.

    You can combine two different types if one is only checked to be existing.

    [if field=myfield value='myvalue' compare=less and var='myvar']

    In this case you can add also more fields. But to compare field and vars in one if with values does not work.

    But you can check if this works:

    [if field=myfield value='myvalue' compare=less and var='myvar' and var_2=myvar value_2='myvalue2' compare_2=less]

    • This reply was modified 3 years, 10 months ago by polarracing.
    • This reply was modified 3 years, 10 months ago by polarracing.
    • This reply was modified 3 years, 10 months ago by polarracing.
    Thread Starter finnfin

    (@finnfin)

    Thanks! That actually does seem to work, unless I’m just missing something. Not sure I understand why it works, but it does seem to. ??

    Btw, documentation mentions 5 as the limit for nested IF loops. Is that 5 counting the top level, as in total 5 IFs?
    Edit. nevermind, got my answer. It’s 5 IFs total. In other words -----IF does not work.

    • This reply was modified 3 years, 10 months ago by finnfin.

    Thanks! That actually does seem to work, unless I’m just missing something. Not sure I understand why it works, but it does seem to.

    The reason is, that you can not address for what type the value stands. So, if you use two times value or value_1 its not clear if you mean the field or the var.

    In this case its clear where the value belongs to.

    [if field=myfield value='myvalue' compare=less and var='myvar' and var_2=myvar value_2='myvalue2' compare_2=less]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Two conditions var and field’ is closed to new replies.