Skip to main content
April 8, 2024
Question

IF condition in expression of Appian with AND and OR operators.

  • April 8, 2024
  • 4 replies
  • 0 views

Hello, We are trying to compare two variables data inside 'IF' condition  on Appian interface but we are not sure how to apply AND and OR condition? Kindly let us know, how to add AND and OR operators in 'IF' condition. We tried using 2 different approaches but getting error 'The function 'if' [line 1] has 3 parameter(s), but instead passed 4 parameter(s).'

1. if(not(isnull(local!customeraccountnumber)) AND (local!selectedTab > 1)
, true(),
false())

2. if(not(isnull(local!customeraccountnumber)) && local!selectedTab > 1, true(), false())

    4 replies

    konduruc733182
    April 8, 2024

    Hello Please check the below code,

    if(
      and(
        not(isnull(local!customeraccountnumber)),
        (local!selectedTab > 1)
      ),
      true(),
      false()
    )

    Documentation

    and()

    or()

    harshitb6843
    April 8, 2024

    Enhancing it further, we don't need to add an 'if' condition if you want to set a boolean as output. You can simply add the condition. 

    and(
        not(isnull(local!customeraccountnumber)),
        (local!selectedTab > 1)
    )

    stefanhelzle0001
    April 8, 2024

    AND and OR are functions. and/or(true, false, true)

    In general, Appian expressions is a functional language where you wrap function calls in function calls.

    shubhama926776
    April 8, 2024

    Appian If statements don't use native AND (&&) or OR (||) operators.
    Use and() and or() functions for combining conditions.
    AND Logic:
    if(and(condition1, condition2), true(), false())
    OR Logic:
    if(or(condition1, condition2), true(), false()).