Skip to main content
Nintex Community Menu Bar

I'm working in Nintex Forms Designer 2013 and I created a form. There's a panel that I want to hide until the very end, so I'm trying to write a condition to unhide it, if certain controls are picked. The controls don't need to be chosen one after the other either. I saw a sample on how to create it and it didn't work. 

OutputDelivery!= "Ad-hoc/One Time" || DiscontinueProcessReport!= Yes

Though I will need to know more about what conditions need to be met in order for your panel to be shown, I will go on and give you some info about Rules that might help you faster.

1. If you're targeting a Yes / No control in your Rule, you should use true or false instead.



 



Yes (or checked) = true



No (or unchecked) = false



 



Simply typing myControlName != Yes will typically lead to a form error (or at least does in the latest version of NW/NF for SP 2016!).



 



2. When you want the Rule to *do* its thing (Hide, Disable, or Invalidate) then whatever condition your checking should return true.



 



Knowing that, lets dissect the code you've shared:



OutputDelivery != "Ad-hoc/One Time" || DiscontinueProcessReport != Yes

 



We could translate that into: 



 



Hide The Pane When -





  • OutputDelivery Does NOT equal "Ad-hoc/One Time"

    OR



  • DiscountinueProcessReport Is NOT true




 



Meaning that in order for your Panel to be shown





  • OutputDelivery MUST equal "Ad-hoc/One Time"
    AND


  • DiscountinueProcessReport MUST be false (No)




 



3. Working with formatting rules that require multiple conditions can be difficult at first, but generally it's easier if you avoid using 'Or' (||) statements, and instead use AND (&&) statements with conditions of when you want the rule to NOT hide or disable a control, then wrapping those conditions in parens and inverting them with an exclamation point at the start.



 



For instance, if I had two choice controls: 





  • Choice123, with the choices Option 1, Option 2, and Option 3


  • ChoiceABC, with the choices Option A, Option B, and Option C




 



And I wanted to make a rule to show a Panel only when Choice123 was set to "Option 3" and ChoiceABC was set to "Option A", then I could write my rule in the following way:



!(Choice123 === "Option 3" && ChoiceABC === "Option A")

 



 



Because I'm using the AND operator:



Choice123 === "Option 3" && ChoiceABC === "Option A"

 



That condition will only return true if BOTH of those statements are true. 



 



Because I wrap it with the exclamation point and parens:



!()

 



It inverts the entire condition, so when it returns true (meaning both conditions are met), that value is inverted and the Rule sees that it fully returned false, meaning that the Rule should SHOW the panel. Because this will only ever happen when my controls equal the values I specified, the condition will return false, be inverted to true, and the rule will Hide the panel because of it. 



 



I hope that this brief overview will provide a little insight into how the Rule system and JavaScript works. If you are still having trouble with your rule, please provide a little more information so that we can help you further. 


I'm sorry maybe I didn't explain it correctly. I want a particular panel to UNHIDE if any of these choices are picked/filled out.  It would be 



 



Output Delivery (choice control) is Ad-hoc/One time 



OR



SharePoint location/Email Distribution List (multi–Line Textbox control) is "there has to be text in the field"



OR



Decommission Effective Date (Date Control Only) is "there needs to be a date" 



OR 



Effective Date is Before Request Submit Date (choice control) is "No"



OR



Prior Report Needs Restated (choice control) is "No"



OR 



Restated Date Period (Date Control Only) is "There needs to be a date" 



 



The panel will only show if one of the statements above are chosen, rather than having both statements true, that you showed at the bottom. Hopefully that helps.



 



I do appreciate your extensive explanation and it did help me understand how to write it out if both conditions were true and the structure, meaning the spaces in between the rule. 



 


Using your supplied logic, I have created all of the controls on a form alongside a Panel:





 



Each Control is Configured as Shown



 



OutputDelivery:





 



Effective Date is Before Request Submit Date:





 



Prior Report Needs Restated:





 



SharePoint location/Email Distribution List:





 



Decommission Effective Date:





 



Restated Date Period:





 



I then created a Rule on the Panel and set the formula:





 





 



The Formula in a form that can be copied:



!(OutputDelivery === "Ad-hoc/One Time" ||

!isNullOrEmpty(SharePoint location/Email Distribution List) ||

!isNullOrEmpty(Decommission Effective Date) ||

!isNullOrEmpty(Restated Date Period) ||

Effective Date is Before Request Submit Date === "No" ||

Prior Report Needs Restated === "No")


 



(Note 1: Remember to replace all of the Control Names with the Reference Controls for YOUR form! that is, they need to be in red!)



 



(Note 2: In my first post I talked about how Yes/No controls return true or false, but you've shown me that instead of using a Yes/No Control Proper, you've setup a Choice Control with (presumably) the options of "Yes" or "No", and the proper way to check those values IS by using a String of whatever it is you wanna check, hence why I used the ControlName === "No" in my rule's formula above)



 



Because I've placed all of the potential conditions for when I want the Panel to be shown inside of a Parentheses with a leading exclamation point, it will invert the outcome of the condition evaluated inside of those parentheses. Therefore if ANY of our conditions are true, they will be inverted to false, and the Panel will show. However if NONE of our conditions are true, then the entire conditional is considered false, which when inverted to true, hides our panel. 



 



The Results Are



 



Nothing Selected:





 



One of the Control Checks is true:





 





 





 





 





 





 



Likewise if we set a bunch of controls to values that do not meet our rule's conditions:





 



 



I hope that this helps to set things straight and you can get your Formatting Rule to work. Let me know if you need additional help!


OMG THAT WORKED 🙂 !!! You're AMAZING. Thank you so much for your help! I appreciate your visuals that you provided. That was so helpful! 



 



I do have one more question on the first reply you made if both statements are true then a panel would unhide.  Example:  



! (Request Cagetory(Choice control) === "Data Report" && State(choice category) === "Anything chosen in the category")



 



Then the hidden panel would unhide.



 



 


Glad I could help, please mark my comment as the Solution to your problem if it has worked



 



as for your second question I'm not entirely sure what you're asking me



 



If you want the panel to be shown when both conditions are true then something like this would work:



!(Request Cagetory === "Data Report" && !isNullOrEmpty(State))

 



 



for the opposite effect, simply remove the starting "!":



(Request Cagetory === "Data Report" && !isNullOrEmpty(State))

 



 



Does that make sense?


Sorry, I probably didn't explain it well. 



I want the panel to be shown when both conditions are true. 



 



Request Category (choice control) is Data Report



AND



Market (Choice control) is any choice picked in the choices. 





 



The hidden panel will only show if these two are true. 



 



I did write a condition that unhid the panel but where "IL" is, I want to be if they pick any market in the choices, then the panel will unhide, not just if they pick IL. 



 





 



 



 


Then you would need to put Market inside of a isNullOrEmpty() function like:



!(RequestCategory === "Claims Report" && !isNullOrEmpty(Market))

 



Likewise you could say:



RequestCategory !== "Claims Report" && isNullOrEmpty(Market)

 



also you said "Request Category (choice control) is Data Report" but in your code example you have shown everything as "Claims Report", if you want the above code to work with a choice called "Data Report" then please change it. 



 



Let me know if that works 


Thank you! It worked!!! I really appreciate you helping me! 


no problem! that's why we're here!


Reply