Appian expression rule strange behaviour

Certified Associate Developer

Hello,
Consider the following test code:

a!localVariables(
    local!Torerance_Name:"Mean",
    local!test_0: and(
        local!Torerance_Name = "Mean",
        "15.0"
    ),
    local!test_1: and(
        local!Torerance_Name = "Mean",
        "8.2"
    )
)


Here test_1 has value : false and test_0 has value true.
What is the cause of this? Please find the screenshot as follows:

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to Sowvik Roy

    The and() function expects a list of boolean arguments.  Neither the text value "15.0" or "8.2" are boolean values.  My guess is that when the and() function is typecasting both of these to boolean, it gets as far as seeing that "15.0" starts with "1", which aliases to a value of "TRUE" in most contexts, and thus casts it as "TRUE"; and likewise when it sees that "8.2" does not start with "1", it gets cast as "FALSE".

    Any chance you tested this out?

    So to answer your first question: no, it's not an Appian bug.

    To echo Stefan as usual, what are you trying to achieve when you put the "15.0" and "8.2" text values in this rule?  If I could tell what your intended rationality was I'd love to help you come up with the appropriate expression, but I'm struggling to understand.