# Can we link repeat group question with a checkbox question

**URL:** <https://forum.dimagi.com/t/can-we-link-repeat-group-question-with-a-checkbox-question/3573>\
**Category:** Users\
**Created:** [June 21, 2017, 11:18am UTC](https://forum.dimagi.com/t/can-we-link-repeat-group-question-with-a-checkbox-question/3573 "2017-06-21T11:18:27Z")\
**Posts on this page:** 1\
**Page:** 1

<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 21, 2017, 11:18am UTC](https://forum.dimagi.com/t/can-we-link-repeat-group-question-with-a-checkbox-question/3573/1 "2017-06-21T11:18:27Z")

</div>

Hello,

You could use 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  
(with Q1 as the argument) as the `count` of your repeat to repeat once for  
each selected item.

Cheers,  
Will

> **···**
>
> On Fri, Jun 16, 2017 at 5:06 AM, wrote:
> 
> > Hey folks
> > 
> > I am interested in linking a repeat group questions with the options  
> > selected in previous checkbox questions.
> > 
> > For example:
> > 
> > Q1: What water sources do you use: (a) government provided (b) handpump  
> > (c) borewell (d) dug well (e) purchased water (f) others
> > 
> > Q2 (a) How far is the source from your place
> > 
> > Q2 (b) how many members go to fetch water- males and females
> > 
> > Q2 (c) water is used for what purposes- drinking, household, irrigation,  
> > livestock
> > 
> > Now I want to ask Q2 only for each of the options selected in Q1 only.
> > 
> > Currently, I ask an additional question on how many water sources do you  
> > use to have a numeric link to repeat group question.
> > 
> > Is there a way out?
> > 
> > Thanks in advance!
> > 
> > --  
> > 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).
