logical function AND()

Can anyone explain why and(null)  is true

  Discussion posts and replies are publicly visible

  • Per the documentation on fn!and(), this function will only return false if any of the values provided are false, and it also notes that empty arrays evaluate to true.

    The standard practice here if you may have an input value of null which you would like to return as false, is to check for these first within an if() statement.  This code below will check an array containing nulls and return false if any nulls are present:

    a!localVariables(
      local!data: {true,null},
      
      and(
        a!forEach(
          items: local!data,
          expression: if(
            rule!APN_isEmpty(fv!item),
            false,
            fv!item
          )
        )
      )
    )