cancel
Showing results for 
Search instead for 
Did you mean: 
Nintex Newbie

Calculate the number of form controls

Hi,

I have a requirement to count the number of "unhidden" controls in a form. Take the example below:

A choice control hides 1 or 2 calculated value controls. I need to display a total for the number of calculated values being displayed. For example:

When one calculated value control is displayed the count should return "1":

When two calculated value controls are displayed the count should return "2":

Is there some kind of JS sorcery that can identify whether a control is hidden or displayed and provide a count? I have attached an export of the form shown in these examples.

Labels: (3)
0 Kudos
Reply
4 Replies
Highlighted
Automation Master
Automation Master

Re: Calculate the number of form controls

Hi,

wouldn't evaluating your dropdown being easier than counting the hidden/unhidden controls?

You have 3 controls shown max. and the dropdown either hides one or two columns. Which means depending on the value of your dropdown there are either 1 or 2 controls shown.This probably won't even require javascript as you should be able to implement this with calculated values and formulas.

Please let us know, if this is not an option for you and why it isn't.

Regards

Philipp

Reply
Highlighted
Nintex Newbie

Re: Calculate the number of form controls

Hi Philipp,

Thanks for responding. That's a good question and an interesting approach.

The example I've provided above is a simplified version of the solution I'm developing. In my actual solution I have a range of 21 calculated value controls that are displayed based on quite a number of formatting rules.

Mitch

Reply
Highlighted
Automation Master
Automation Master

Re: Calculate the number of form controls

I see. I would start by inspecting the DOM at this point. Open up your form in preview mode and run your browsers developer tools. Try to find your hidden/unhidden controls and see how they are hidden. There should be some flag/property/inline-styling that decides whether your controls are hidden or visible.

Afterwards you need to create some Javascript function to loop through all your conditional hidden controls and count the number of controls that are not hidden.

Regards

Philipp

Reply
Highlighted
Nintex Newbie

Re: Calculate the number of form controls

Another great approach, thanks Philipp. When I return to this task I will give that a try and feedback with any results.

0 Kudos
Reply