I'm having issues with my nested if statements. My conditional statement is shown in the image. I want my form to act this way;
I think I may be applying the "or" statement incorrectly. This worked fine in my excel form. is it different with nintex?
Solved! Go to Solution.
Hmm, seems right to me.
What current displays if you meet any of your OR conditions?
What displays if you meet NONE of your OR conditions but SOME of your AND conditions?
What's displaying if you don't meet ANY conditions?
Knowing what happens at present will help for sure! ...Probably!
Message 1 is being displayed when either of the first 2 statements in the "or" bracket is true. It's ignoring the remaining statements.
I m getting the desired outcome for both message 2 and 3.
Sometimes its better to break a big problem into smaller parts and test. In other words, test each rule part, piece by piece to make sure you are getting a "true" result and then keeping building your rule up from there. May take more dev time with this approach, but a lot less on the troubleshooting side.
Try using || and &&
If( ExtNoForDialExtensions1 == "No" || RestrictSetss =="Yes" || PickUp=="Yes" || AboveOne =="Yes" || Multical== "Yes" || DigitalTrans == "Yes", "Message 1" ,If( ExtNoForDialExtensions1 == "No" && RestrictSetss =="No" && PickUp=="No" && AboveOne =="No" && Multical== "No" && DigitalTrans == "No","Message 2") ,"Messge 3")
User the proper controls names in the above lines.
Thanks you all for your contributions!
I found that the issue with my nested if statement was that of hierarchy. I arranged the variables in the "or" logical operators in the order they appear in my form and it worked.
Assuming the variables are A,B,C,D and E defined in ascending order in the form. Then my if Statements should be:
If( A == "No" || B=="Yes" || C=="Yes" || D =="Yes" || E== "Yes" || F == "Yes", "Message 1" ,If( A == "No" && B =="No" && C=="No" && D=="No" && E= "No" && F == "No","Message 2") ,"Messge 3")
I also did some testing and the order of the variables doesn't affect the "AND" operator.
Thought I should share this for anyone who may have the same challenge I did.
1. problem with your original formula was that you supplied too many arguments to or() and and() functions.
see their definition in help pages - they both can ONLY accept two arguments
so whatever you supplied as extra argument(s) was simply ignored.
2. have you really used a formula from your most recent post?
unlike your original post, this one is syntactically not correct, so can not (reliably) work.
I arranged the variables in the "or" logical operators in the order they appear in my form and it worked.
why do you think order/placement of controls on the form should/might have impact on formula evaluation?
would you expect that with every single control movement or when a control is added deleted, one would need to rewrite all the rules/calculation/etc just because of that?
if you can not spot the problem in evaluation, it's always the best approach to proceed from evaluation of simplest possible expression up to complex one(s), as Mike M suggested above
1. I read the documentation before I even posted my question. No where in the document did it explicitly say that the "or" logical operator can only receive two arguments( aka I took the usage as an example).
If( or (A == "No" , B=="Yes" , C=="Yes" , D =="Yes", E== "Yes" , F == "Yes"), "Message 1" ,If( and(A == "No", B =="No", C=="No" , D=="No" , E= "No" , F == "No"),"Message 2" ,"Messge 3"))
works too. Only after arranging the variable in the order they appear in the form
2. Yes, and it works! I used Sojan Mathew suggestion because Nintex won't accept the formula in my initial post. both formulas are syntactically correct.
3. I don't know why this is so in Nintex. I just shared my experience.