# Problems with checkbox questions

**URL:** <https://forum.dimagi.com/t/problems-with-checkbox-questions/3566>\
**Category:** Users\
**Created:** [June 15, 2017, 1:43pm UTC](https://forum.dimagi.com/t/problems-with-checkbox-questions/3566 "2017-06-15T13:43:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donald\_Richards](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@Donald\_Richards](https://forum.dimagi.com/u/Donald_Richards)\
**Post date:** [June 15, 2017, 1:43pm UTC](https://forum.dimagi.com/t/problems-with-checkbox-questions/3566/1 "2017-06-15T13:43:04Z")

</div>

Dear all.

I am writing a display condition for a question within an survey I did  
through Commcare.  
The question is a checkbox type, I want to display a following question  
only if the person chooses 1 specific option plus any of the others from  
the checkbox list.

For example:  
I have these answers: apple, banana, peach and strawberry. My idea is to  
pop-up a following question only when the person chooses strawberry AND any  
of the others (it can be one, two or the three other options at same time).  
It is mandatory to choose strawberry.

Hope is clear!

Thank you in advance for your support.

Best,

DR

---

<div class="post-metadata">

**Author:** ![William\_Pride](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/w/b19c9b/32.png) [@William\_Pride](https://forum.dimagi.com/u/William_Pride)\
**Post date:** [June 15, 2017, 1:45pm UTC](https://forum.dimagi.com/t/problems-with-checkbox-questions/3566/2 "2017-06-15T13:45:40Z")

</div>

Hello,

The count-selected()  
[https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-count-selected](https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-count-selected)  
function  
should do exactly what you're looking for.

Cheers,  
Will

> **···**
>
> On Thu, Jun 15, 2017 at 9:43 AM, Donald Richards wrote:
> 
> > Dear all.
> > 
> > I am writing a display condition for a question within an survey I did  
> > through Commcare.  
> > The question is a checkbox type, I want to display a following question  
> > only if the person chooses 1 specific option plus any of the others from  
> > the checkbox list.
> > 
> > For example:  
> > I have these answers: apple, banana, peach and strawberry. My idea is to  
> > pop-up a following question only when the person chooses strawberry AND any  
> > of the others (it can be one, two or the three other options at same time).  
> > It is mandatory to choose strawberry.
> > 
> > Hope is clear!
> > 
> > Thank you in advance for your support.
> > 
> > Best,
> > 
> > DR
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "commcare-users" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [commcare-users+unsubscribe@googlegroups.com](mailto:commcare-users+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Donald\_Richards](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@Donald\_Richards](https://forum.dimagi.com/u/Donald_Richards)\
**Post date:** [June 15, 2017, 2:04pm UTC](https://forum.dimagi.com/t/problems-with-checkbox-questions/3566/3 "2017-06-15T14:04:11Z")

</div>

Thank you William,

It worked! I used the selected function AND the count-selected.

Best,  
DR

> **···**
>
> El jueves, 15 de junio de 2017, 15:45:45 (UTC+2), William Pride escribió: \> \> Hello, \> \> The count-selected() \> function \> should do exactly what you're looking for. \> \> Cheers, \> Will \> \> On Thu, Jun 15, 2017 at 9:43 AM, Donald Richards \<herr.e...@gmail.com \> wrote: \> \>\> Dear all. \>\> \>\> I am writing a display condition for a question within an survey I did \>\> through Commcare. \>\> The question is a checkbox type, I want to display a following question \>\> only if the person chooses 1 specific option plus any of the others from \>\> the checkbox list. \>\> \>\> For example: \>\> I have these answers: apple, banana, peach and strawberry. My idea is to \>\> pop-up a following question only when the person chooses strawberry AND any \>\> of the others (it can be one, two or the three other options at same time). \>\> It is mandatory to choose strawberry. \>\> \>\> Hope is clear! \>\> \>\> Thank you in advance for your support. \>\> \>\> Best, \>\> \>\> DR \>\> \>\> -- \>\> You received this message because you are subscribed to the Google Groups \>\> "commcare-users" group. \>\> To unsubscribe from this group and stop receiving emails from it, send an \>\> email to commcare-user...@googlegroups.com . \>\> For more options, visit https://groups.google.com/d/optout. \>\> \> \>

---

<div class="post-metadata">

**Author:** ![YAW\_ANTWI-ADJEI](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/y/c0e974/32.png) [@YAW\_ANTWI-ADJEI](https://forum.dimagi.com/u/YAW_ANTWI-ADJEI)\
**Post date:** [June 15, 2017, 2:08pm UTC](https://forum.dimagi.com/t/problems-with-checkbox-questions/3566/4 "2017-06-15T14:08:58Z")

</div>

Hi  
Just out of curiosity, if it is mandatory, why ask? This is data you knew  
before going to the field so it should already be in your database.

Yaw

> **···**
>
> On 15 June 2017 at 14:04, Donald Richards wrote:
> 
> > Thank you William,
> > 
> > It worked! I used the selected function AND the count-selected.
> > 
> > Best,  
> > DR
> > 
> > El jueves, 15 de junio de 2017, 15:45:45 (UTC+2), William Pride escribió:
> > 
> > > Hello,
> > > 
> > > The count-selected()  
> > > [https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-count-selected](https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-count-selected) function  
> > > should do exactly what you're looking for.
> > > 
> > > Cheers,  
> > > Will
> > > 
> > > On Thu, Jun 15, 2017 at 9:43 AM, Donald Richards [herr.e...@gmail.com](mailto:herr.e...@gmail.com) wrote:
> > > 
> > > > Dear all.
> > > > 
> > > > I am writing a display condition for a question within an survey I did  
> > > > through Commcare.  
> > > > The question is a checkbox type, I want to display a following question  
> > > > only if the person chooses 1 specific option plus any of the others from  
> > > > the checkbox list.
> > > > 
> > > > For example:  
> > > > I have these answers: apple, banana, peach and strawberry. My idea is to  
> > > > pop-up a following question only when the person chooses strawberry AND any  
> > > > of the others (it can be one, two or the three other options at same time).  
> > > > It is mandatory to choose strawberry.
> > > > 
> > > > Hope is clear!
> > > > 
> > > > Thank you in advance for your support.
> > > > 
> > > > Best,
> > > > 
> > > > DR
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "commcare-users" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [commcare-user...@googlegroups.com](mailto:commcare-user...@googlegroups.com).  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "commcare-users" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [commcare-users+unsubscribe@googlegroups.com](mailto:commcare-users+unsubscribe@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
