Set Field based on Valid Checkboxes

  • 4 April 2017
  • 7 replies
  • 35 views

Userlevel 6
Badge +15

Hi folks!

I am trying to figure something out and I have a feeling I am looking past something very simple, and so, I bring it to you: the community.

I have a large checklist.

Each checkbox has a validation on it - ie, "Disabled if X application is not required".

Or "Disabled if X was not requested."

What I'd like to do is have a message - "The checklist is not yet complete." - that is replaced with "The checklist is now complete!" when the checklist is (surprise) complete.  (Or, hiding the submit button and only allowing the save button until the checklist is complete.)

This is a checklist that the user will be coming in and out of until finished.

I suppose my question is: is there a way to say "check to see if all VALID checkboxes are checked"?

Note that this is valid checkboxes, not required checkboxes -- none of these are required; the workflow just won't move on until all checkboxes are checked.

I also considered just switching over a message once the WF moves on, but, this is something where the user will want to see the message change when they click that last checkbox in the form.

Thoughts?

Thank you folks!

Rhia


7 replies

Userlevel 5
Badge +14

I'm not sure whether I understand the requirements correctly.

you have list of checkboxes.

some of them are disabled.

what about rest of checkboxes (not disabled ones), are they in your meaning "required checkboxes" or "valid checkboxes"?

in former case I do miss info how to identify set of 'valid checkboxes'.

as well, what's behind checkboxes, choice or lookup control/field?

This is a checklist that the user will be coming in and out of until finished.

does that mean that user should be able to save form with not completed checklist without validation applied?

are you already on a forms that support 'save and continue' functionality?

the workflow just won't move on until all checkboxes are checked.

so do you need the check on form (task form?) or workflow?

I as well assume the task is for whole checklist , not per single checkboxes...

Userlevel 6
Badge +15

you have list of checkboxes.

some of them are disabled.

what about rest of checkboxes (not disabled ones), are they in your meaning "required checkboxes" or "valid checkboxes"?

Yep! 

So there are 3 sections of checkboxes:

  • Core (required for all users) - about 10
  • Applications (1 - 6 may be selected, or none.)
  • Custom (required for some users) - about 7

The requirement of each is dependent on different factors. 

Applications -- did the manager request an application, and, has it been approved. So, two things there.

Custom - ie, did they ask for a phone? What kind of phone was it?

Does that account require to be copied? Was it copied?

So it's all different criteria. There is a submit button, and a save button, and they do essentially the same thing at this point in the form. What I want is to say "if the form is at X stage, and checkboxes X, Y, and Z (though it might be a billion different combinations), then hide submit. if they are all checked, show submit."

Mind you, I've been thinking about this in the mean time. What do you think of this ...

I suppose I can say "if (requirements for checkbox to be valid) are valid, and checkbox is checked, then 1... otherwise, 0" - then have a calculated field that says "if value is greater than 0, hide submit button. if equal to, show submit button."

So for example that'll be something like...   equals(App1Req == "Yes" && App1Approved == "Yes" && App1Check == "Yes", 0, 1)

I guess what I was hoping for was a way to select a group of checkboxes and say " equals(GroupOfCheckboxes == Enabled, 1, 0)

(Enabled in this case means "not disabled by rules")

Badge +5

this looks more like a task for javascript than nintex rules 

you can use Jquery selectors to figure out whether a bunch of check boxes are checked or not.

any chance you can post a screen shot to get more idea?

Userlevel 5
Badge +14

so the checkboxes are single yes/no controls, right?

not sure why I though of choice(s).

either way, moreless the same approach could be used for both.

here is how could it be done for checkboxes.

use runtime functions that can work on arrays, eg. length(array) gives you number of elements in array, sum(array) adds up elements in array (for checkboxes - true/flase = 1/0 it adds up number of checked checkboxes).

to determine number of disabled checkboxes a little bit more complex formula might be needed, but it's still achievable with single calculated value control.

see examples

if you combine these formulas with formulas that identify which/how many checkboxes should be checked at most/least (per section or overall), I think you should manage to get what you need.

‌ number of‌

Userlevel 6
Badge +15

This is how I ended up doing it (as mentioned in previous post) and it works well! I put the validation for the checkbox as well as "checkbox == false" for each one, and made it 1 if false and 0 if true. 

Will mark your comment correct when I'm at a computer! 

Userlevel 5
Badge +14

I have meant it as one validation per group of checkboxes (section).

eg for core section (all CBs required) it could look like (if nothing is disabled):  length([list of core CBs]) != sum([list of core CBs]) => do not pass validation

(no IFs or conversions to 0/1 are needed)

but that assumes you are able to build one general validation check per section out of all those application and custom requirements, eg. sum([list of app CBs]) < NumberOfAppsRequested => do not pass validation

if those requirements are too granular or too complex I afraid there is no other way then create a validation per single checkbox.

Userlevel 6
Badge +15

Yeah - my case was unfortunately too granular. Ah well.

I was so hoping this thread would unsurfaced some kind of "Checkbox == enabled" or "Checkbox == disabled" logic, haha.

Thanks folks happy.png

Reply