Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to sum the true check box on the checkbox field ?

Saurabh C
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 10, 2020

Hi,

So I have create a form to get some assessment for some subjects and have a checkbox field (Subject), It has around 25 options, but I want to restrict the checkbox selection by user to a max of 5, how can I sum up the selected(True) checkboxes and then run a validation.

I have currently used below 3 forms

Registration form

Form definition

Field form definition.

 

@Alex Medved _ConfiForms_ : If you could help, that would be great !

 

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
November 11, 2020

I believe you are talking about a "checkbox group" field, not "checkbox".

As  "checkbox" field has only 2 possible values: true or false

For "checkbox group" field (and for any other multi-value holding field) you can always check it's size via asCount or asLength virtual functions

So, your condition for validation will be (in ConfiForms Field Definition Rules macro, action = Validation Rule)

Subject.asCount:>5

Dont forget to set the "Message to show when validation rule matches"

Saurabh C
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 11, 2020

Thanks a Ton  Alex Medved _ConfiForms_ , was really not able to find asCount variable field anywhere....

 

You are awesome !

Alex Medved _ConfiForms_
Community Champion
November 11, 2020

This is not a field really, but a function (among other virtual functions we have in ConfiForms ) that you can use on a field

Like Saurabh C likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events