Multiple layers of hiding in Nintex Forms


Badge +6

Hello!

I have a job request form that has several panels of questions hidden based on the answer to the initial question about what type of job the request is. One of the categories needs the questions to show up but we need an additional layer of validation before it shows up. Right now, if someone selects "Health Promotion" the questions for the job pop up appropriately. However it is possible that the business owner is still not supposed to submit their request to our team. Therefore I have a message that pops up telling them if they should or should not submit the request to us. However, since the questions are below my note, the concern is that they could bypass my message (even if it is in red and bold) and continue to submit the form. I think I need to add some sort of an if statement to the below rule but I don't know how to word it.

This is the formula that I am using to hide the set the set of question until the business owner selects an answer and only if the answer is any 5 of the 6 categories (all but provider).

or(isNullOrEmpty(ProjectJobCategory),equals(ProjectJobCategory,"Provider"))

Health Promotion is one of the 5 allowable categories. If I need to create a separate rule for the extra layer of validation for Health Promotion (Are you on the Health Promotion team?) I can do that, but, I can't get it work seperately without makign the whole form hidden. Here's my rough stab at enhancing my current formula (which obviously didn't work):

or(isNullOrEmpty(ProjectJobCategory),equals(ProjectJobCategory,"Provider"), ProjectJobCategory, "Health Promotion" and Are you a part of the Health Promotion Team?, "yes")


17 replies

Userlevel 6
Badge +16

try using "contains" instead "equals"

Badge +6

like this? I feel like something is wrong with my and section since I am trying to use both an "or" and an "and"

or(isNullOrEmpty(ProjectJobCategory),contains(ProjectJobCategory,"Provider"), ProjectJobCategory, "Health Promotion" and AreyouapartoftheHealthPromotionTeam?, "yes")

Userlevel 5
Badge +14

I'm not sure I understand your scenario correctly.

you have a ProjectJobCategory control (is it a choice?)

it has some 5 options, two of them a 'Provider' and 'Health Promotion'

then you have some 'Are you a part of the Health Promotion Team?' control (is it a yes/no control?)

and you want to hide some panel when either of 3 following is true

- there is no option selected for ProjectJobCategory,

- there is selected 'Provider' option

- there is selected 'Health Promotion' AND 'Are you a part of the Health Promotion Team?'  is set to YES

is that right?

if above assumptions are correct then following could work for you

 

or(isNullOrEmpty(ProjectJobCategory),
     or(inArray(ProjectJobCategory,'Provider'),
         and(inArray(ProjectJobCategory,'Health Promotion'),
                Are you a part of the Health Promotion Team?
          )
      )
 )
Badge +6

This looks great. The only correction I have to the assumptions is it isn't a yes/no check box but it is a yes/no choice (because I need to something else to happen if the answer is yes as well if it is no and for neither to show up if blank). I took I stab at it in blue but I'm sure I'm wrong.

or(isNullOrEmpty(ProjectJobCategory),
     or(inArray(ProjectJobCategory,'Provider'),
         and(inArray(ProjectJobCategory,'Health Promotion'),
                Are you a part of the Health Promotion Team?="Yes")))

Badge +6

Even though I need a yes/no choice instead of a check box I tried the formula because I want to learn, but, it's not hiding from the Provider Choice or the Health Promotion Choice, let alone Health Promotion and Are you a part of the Health Promotion team

Userlevel 5
Badge +14

comparison operator is doubled equal sign

Are you a part of the Health Promotion Team?=="Yes"

Userlevel 5
Badge +14

when you were copying script from here, have you replaced control name placeholders with your real control references? otherwise they will copy as plain text.

check spelling of compared strings whether they fit to your setup.

sometimes it might happen that copy&pasted functions are as well not recognized as functions but rather as texts. so try to build the formula from scratch in your builder without any copying.

Badge +6

Typing the formula instead of copying and pasting made it sort of work as it did something but it blanked out the whole form (including the initial question that needs to be asked. I confirmed that my rule was in the panel of questions I want to hide. Is there a space. When do you use double quotes vs. single quotes?

or(isNullOrEmpty(ProjectJobCategory),or(inArray(ProjectJobCategory,'Provider'),and(inArray(ProjectJobCategory,'Health Promotion (Disease Management)),AreyouapartoftheHealthPromotionTeam)))

Userlevel 5
Badge +14

that's typical symptom that something got syntactically broken on your form.

it might be rule, custom validation, javascript or even data if formulas are ready for some 'sensitive' characters.

in your formula above you eg. miss closing apostrophe for "Health Promotion (Disease Management)"

braces within the same string can cause problems as well.

check developer console, that should give you a hint what's going wrong.

Badge +6

Thanks I found Dev Talk but Developer Console, is there a link for developer console?

Userlevel 5
Badge +14

developer console is part of the browser.

press F12 in browser to open developer console, load the form and then check back in developer console whether there are not reported any errors.

Badge +6

That looks like a really cool tool if I knew how to read it. I am more of a power user than a developer. I don't java script or html or css code which is one of the reasons I love SharePoint

Userlevel 5
Badge +14

have a look on this article Using the Console to view errors and debug (Windows) 

Badge +6

thank you for trying but that is so over my head, I found a missing comma but there has to be something that tells me when to use commas and single vs. double quotes etc.

or(isNullOrEmpty(ProjectJobCategory),or(inArray(ProjectJobCategory,'Provider'),and(inArray(ProjectJobCategory,'Health Promotion (Disease Management)'),IsthisaHealthPromotionLayoutrequest?=='Yes')))

In English is this saying (hide) if 1) empty or 2) provider or 3) health promotion and layout?

Userlevel 5
Badge +14

single or double quotes - it doesn't matter, you just have to use the same ones for a single string

you have some orphaned question mark in IsthisaHealthPromotionLayoutrequest?=='Yes

if you're not able to identify a problem with complex formula, build it step by step, expression by expression until you find the problem.

good approach is to place calculated value controls on the form and set up their formulas from simplest expression up to complex ones, so that you can exactly track each of them how do they evaluate.

eg.

1st calc control's formula: ProjectJobCategory

2nd calc control's formula: isNullOrEmpty(ProjectJobCategory)

etc.

Badge +6

Thank you. I will try that.

Badge +6

This is what ultimately ended up working:

ProjectJobCategory=='Health Promotion (Disease Management)'&&IsthisaHealthPromotionLayoutrequest?=='No'||ProjectJobCategory==''||ProjectJobCategory=='Provider'

Now I am trying something similar to another formula for a separate panel...piece by piece little by little

Reply