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())
Discussion posts and replies are publicly visible
Hello Please check the below code,
if( and( not(isnull(local!customeraccountnumber)), (local!selectedTab > 1) ), true(), false() )
Documentation
and()
or()
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.
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()).
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) )