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).
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):
Solved! Go to Solution.
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
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.
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
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.
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?
that's typical symptom that something got syntactically broken on your form.
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.