Could someone explain why the following code work without compiler errors?
if( isnull(ri!user), "", isusernametaken(ri!user), user(ri!user, "firstName") & " " & user(ri!user, "lastName"), joinarray(split(ri!user, "."), " ") )
I expect some kind of evaluation error, but it works just as the three lines starting on "isusernametaken" were an embedded if.
I saw that in one of the Appian courses and I'm wondering if it is some undocumented feature of the if function.
Thank you
Discussion posts and replies are publicly visible
if() has 3 parameter
condition and true, false statementhttps://docs.appian.com/suite/help/22.1/fnc_logical_if.html
if you like to use morecheck a!match()https://docs.appian.com/suite/help/22.1/fnc_logical_match.html-> this is just a kind of mistake in the appian course. at least unproper use.
Thank you Richard, but why it does not trigger an error or warning in rule designer?
Lets say, as its not completely wrong in the sense that the rule is not technically breaking there is no error message.-> as far as i remember you reported that issue already?
I believe this is the other post: https://community.appian.com/discussions/f/new-to-appian/24293/why-if-takes-more-arguments-than-3
Like others have said, the validation for if() is that it must accept an odd number of parameters (so technically it does accept more than 3). However, this behavior is undocumented and I don't recommend using it.