Repeat a Set of Questions based on Number provided for a previous question

Hello Community,

I need help with resolving a repeat group item in my XLSForm.

Example: If the user specifies 2, I want the next question to repeat twice
and accept entries 2 times.
I have something like this:

*type * *name *

··· * label repeat_count* select_one LS_number q2a 2. How many owners who refused are available? begin repeat repeat_group Owner Reason select_one LS_reasons r1 2a. Why did the Owner refuse? ${q2a} end repeat

I want Question 2a. to repeat based on the answer provided for Question 2.
But ODK allows you to add more Groups at 2a. until you choose "Do not add".

Thank you,
Bryan

You can use repeat_count (look for the column in the xlsform template).

··· On Monday, January 23, 2017 at 10:03:47 PM UTC+7, Test Isolate wrote: > Hello Community, > > I need help with resolving a repeat group item in my XLSForm. > > Example: If the user specifies 2, I want the next question to repeat twice and accept entries 2 times. > I have something like this: > > type name label repeat_count > > > > > > select_one > LS_number > q2a > 2. How many owners who refused > are available? > > > begin repeat > repeat_group > Owner Reason > > > select_one LS_reasons > r1 > 2a. Why did the Owner refuse? ${q2a} > > > > > end repeat > > I want Question 2a. to repeat based on the answer provided for Question 2. > But ODK allows you to add more Groups at 2a. until you choose "Do not add". > > Thank you, > Bryan

https://lh3.googleusercontent.com/-3dDaj0wDqao/WIhwcd_0_CI/AAAAAAAAAAQ/zoKwFCt0SgMUtctqDJ9nQTjl1mvYx-QEACLcB/s1600/Screenshot_2017-01-25-09-27-54%255B1%255D.png

https://lh3.googleusercontent.com/-VndzoB9xkWs/WIhwVM6htzI/AAAAAAAAAAM/9Woc7YbD5ZgSSV6b5EOnCG6KzZ8dr4V_gCLcB/s1600/Screenshot_2017-01-25-09-28-07%255B1%255D.png

Thank you, Anonymous Helper!

When I check the xlsform page on repeats ( http://xlsform.org/#repeats )
and implement the
concept there; I still get an error. Please see screenshot attached.
I'm not sure if it's because I made the question that initiates the repeat
group [select_one] type instead of an [integer] type..???

Thank you,

Bryan
(Ghana-West Africa)

··· On Wednesday, January 25, 2017 at 2:54:14 AM UTC, tru...@rta.vn wrote: > > You can use repeat_count (look for the column in the xlsform template). > > > On Monday, January 23, 2017 at 10:03:47 PM UTC+7, Test Isolate wrote: > > Hello Community, > > > > I need help with resolving a repeat group item in my XLSForm. > > > > Example: If the user specifies 2, I want the next question to repeat > twice and accept entries 2 times. > > I have something like this: > > > > type > name > label > repeat_count > > > > > > > > > > > > select_one > > LS_number > > q2a > > 2. How many owners who refused > > are available? > > > > > > begin repeat > > repeat_group > > Owner Reason > > > > > > select_one LS_reasons > > r1 > > 2a. Why did the Owner refuse? > ${q2a} > > > > > > > > > > end repeat > > > > I want Question 2a. to repeat based on the answer provided for Question > 2. > > But ODK allows you to add more Groups at 2a. until you choose "Do not > add". > > > > Thank you, > > Bryan > >

Likely the question 2 results in a non-integer and positive (perhaps it's a
text) number so that it violates the repeat_count.

image

··· *----------------------------------------*

LE DANG TRUNG, PhD
Chief Economist
[image: rta_logo]

Real-Time AnalyticsA: 1101, 11th Fl, Citilight Tower, 45 Vo Thi Sau,
District 1, HCMC
T: +84 8 6684 6530
M: +84 979 344 227
E: trungle@rta.vn thule@rta.vn
W: www.rta.vn

Disclaimer:

This message is private and confidential. If you have received this
message in error, please notify us and remove it from your system. Any
views or opinions presented here may be those of the originator and are not
necessarily those of Real-Time Analytics.

On Wed, Jan 25, 2017 at 4:34 PM, Test Isolate testisolate@gmail.com wrote:

https://lh3.googleusercontent.com/-3dDaj0wDqao/WIhwcd_0_CI/AAAAAAAAAAQ/zoKwFCt0SgMUtctqDJ9nQTjl1mvYx-QEACLcB/s1600/Screenshot_2017-01-25-09-27-54%255B1%255D.png

https://lh3.googleusercontent.com/-VndzoB9xkWs/WIhwVM6htzI/AAAAAAAAAAM/9Woc7YbD5ZgSSV6b5EOnCG6KzZ8dr4V_gCLcB/s1600/Screenshot_2017-01-25-09-28-07%255B1%255D.png

Thank you, Anonymous Helper!

When I check the xlsform page on repeats ( http://xlsform.org/#repeats )
and implement the
concept there; I still get an error. Please see screenshot attached.
I'm not sure if it's because I made the question that initiates the repeat
group [select_one] type instead of an [integer] type..???

Thank you,

Bryan
(Ghana-West Africa)

On Wednesday, January 25, 2017 at 2:54:14 AM UTC, tru...@rta.vn wrote:

You can use repeat_count (look for the column in the xlsform template).

On Monday, January 23, 2017 at 10:03:47 PM UTC+7, Test Isolate wrote:

Hello Community,

I need help with resolving a repeat group item in my XLSForm.

Example: If the user specifies 2, I want the next question to repeat
twice and accept entries 2 times.
I have something like this:

type
name label
repeat_count

select_one
LS_number
q2a
2. How many owners who refused
are available?

begin repeat
repeat_group
Owner Reason

select_one LS_reasons
r1
2a. Why did the Owner refuse?
${q2a}

end repeat

I want Question 2a. to repeat based on the answer provided for Question

But ODK allows you to add more Groups at 2a. until you choose "Do not
add".

Thank you,
Bryan

Thak you, Sir. Le Dang!

The question 2 are listed options and references the numbers from the
[choices] sheet. Where the [name] are
represented in number formats....Like: 1 2 3 4 5

Do I have to change question 2 from the [select_one] type to probably
[integer] ???

Can you please just give an example. I searched the entire group and
seems not to get it, :slight_smile:

Thank you,
Bryan
(Ghana-West Africa)

··· On Wednesday, January 25, 2017 at 9:39:03 AM UTC, Le Dang Trung wrote: > > Likely the question 2 results in a non-integer and positive (perhaps it's > a text) number so that it violates the repeat_count. > > > > *----------------------------------------* > > *LE DANG TRUNG, PhD* > Chief Economist > [image: rta_logo] > > > *Real-Time Analytics*A: 1101, 11th Fl, Citilight Tower, 45 Vo Thi Sau, > District 1, HCMC > T: +84 8 6684 6530 > M: +84 979 344 227 > E: tru...@rta.vn > W: www.rta.vn > > > *Disclaimer:* > > *This message is private and confidential. If you have received this > message in error, please notify us and remove it from your system. Any > views or opinions presented here may be those of the originator and are not > necessarily those of Real-Time Analytics.* > > On Wed, Jan 25, 2017 at 4:34 PM, Test Isolate <testi...@gmail.com > wrote: > >> >> >> >> >> >> >> Thank you, Anonymous Helper! >> >> When I check the xlsform page on repeats ( http://xlsform.org/#repeats ) >> and implement the >> concept there; I still get an error. Please see screenshot attached. >> I'm not sure if it's because I made the question that initiates the >> repeat group [select_one] type instead of an [integer] type..??? >> >> Thank you, >> >> Bryan >> (Ghana-West Africa) >> >> >> On Wednesday, January 25, 2017 at 2:54:14 AM UTC, tru...@rta.vn wrote: >>> >>> You can use repeat_count (look for the column in the xlsform template). >>> >>> >>> On Monday, January 23, 2017 at 10:03:47 PM UTC+7, Test Isolate wrote: >>> > Hello Community, >>> > >>> > I need help with resolving a repeat group item in my XLSForm. >>> > >>> > Example: If the user specifies 2, I want the next question to repeat >>> twice and accept entries 2 times. >>> > I have something like this: >>> > >>> > type >>> name >>> label >>> repeat_count >>> > >>> > >>> > >>> > >>> > >>> > select_one >>> > LS_number >>> > q2a >>> > 2. How many owners who refused >>> > are available? >>> > >>> > >>> > begin repeat >>> > repeat_group >>> > Owner Reason >>> > >>> > >>> > select_one LS_reasons >>> > r1 >>> > 2a. Why did the Owner refuse? >>> ${q2a} >>> > >>> > >>> > >>> > >>> > end repeat >>> > >>> > I want Question 2a. to repeat based on the answer provided for >>> Question 2. >>> > But ODK allows you to add more Groups at 2a. until you choose "Do not >>> add". >>> > >>> > Thank you, >>> > Bryan >>> >>> >

No need to change the question type, just force the value type to int() in
the repeat_count column:

int(${q2a})

Jason

··· On Wednesday, January 25, 2017 at 7:30:24 AM UTC-5, Test Isolate wrote: > > Thak you, Sir. Le Dang! > > The question 2 are listed options and references the numbers from the > [choices] sheet. Where the [name] are > represented in number formats....Like: 1 2 3 4 5 > > Do I have to change question 2 from the [select_one] type to probably > [integer] ??? > > *Can you please just give an example*. I searched the entire group and > seems not to get it, :) > > Thank you, > Bryan > (Ghana-West Africa) > > On Wednesday, January 25, 2017 at 9:39:03 AM UTC, Le Dang Trung wrote: >> >> Likely the question 2 results in a non-integer and positive (perhaps it's >> a text) number so that it violates the repeat_count. >> >> >> >> *----------------------------------------* >> >> *LE DANG TRUNG, PhD* >> Chief Economist >> [image: rta_logo] >> >> >> *Real-Time Analytics*A: 1101, 11th Fl, Citilight Tower, 45 Vo Thi Sau, >> District 1, HCMC >> T: +84 8 6684 6530 >> M: +84 979 344 227 >> E: tru...@rta.vn >> W: www.rta.vn >> >> >> *Disclaimer:* >> >> *This message is private and confidential. If you have received this >> message in error, please notify us and remove it from your system. Any >> views or opinions presented here may be those of the originator and are not >> necessarily those of Real-Time Analytics.* >> >> On Wed, Jan 25, 2017 at 4:34 PM, Test Isolate wrote: >> >>> >>> >>> >>> >>> >>> >>> Thank you, Anonymous Helper! >>> >>> When I check the xlsform page on repeats ( http://xlsform.org/#repeats >>> ) and implement the >>> concept there; I still get an error. Please see screenshot attached. >>> I'm not sure if it's because I made the question that initiates the >>> repeat group [select_one] type instead of an [integer] type..??? >>> >>> Thank you, >>> >>> Bryan >>> (Ghana-West Africa) >>> >>> >>> On Wednesday, January 25, 2017 at 2:54:14 AM UTC, tru...@rta.vn wrote: >>>> >>>> You can use repeat_count (look for the column in the xlsform template). >>>> >>>> >>>> On Monday, January 23, 2017 at 10:03:47 PM UTC+7, Test Isolate wrote: >>>> > Hello Community, >>>> > >>>> > I need help with resolving a repeat group item in my XLSForm. >>>> > >>>> > Example: If the user specifies 2, I want the next question to repeat >>>> twice and accept entries 2 times. >>>> > I have something like this: >>>> > >>>> > type >>>> name >>>> label >>>> repeat_count >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > select_one >>>> > LS_number >>>> > q2a >>>> > 2. How many owners who refused >>>> > are available? >>>> > >>>> > >>>> > begin repeat >>>> > repeat_group >>>> > Owner Reason >>>> > >>>> > >>>> > select_one LS_reasons >>>> > r1 >>>> > 2a. Why did the Owner refuse? >>>> ${q2a} >>>> > >>>> > >>>> > >>>> > >>>> > end repeat >>>> > >>>> > I want Question 2a. to repeat based on the answer provided for >>>> Question 2. >>>> > But ODK allows you to add more Groups at 2a. until you choose "Do not >>>> add". >>>> > >>>> > Thank you, >>>> > Bryan >>>> >>>> >>

Hello Jason,

You are the BEST!! It worked and you are AWESOME!!

Thank you so so much, man.

Cheers!
Bryan

··· On Thursday, January 26, 2017 at 1:35:42 PM UTC, Jason Ives wrote: > > No need to change the question type, just force the value type to int() in > the repeat_count column: > > int(${q2a}) > > Jason > > On Wednesday, January 25, 2017 at 7:30:24 AM UTC-5, Test Isolate wrote: >> >> Thak you, Sir. Le Dang! >> >> The question 2 are listed options and references the numbers from the >> [choices] sheet. Where the [name] are >> represented in number formats....Like: 1 2 3 4 5 >> >> Do I have to change question 2 from the [select_one] type to probably >> [integer] ??? >> >> *Can you please just give an example*. I searched the entire group and >> seems not to get it, :) >> >> Thank you, >> Bryan >> (Ghana-West Africa) >> >> On Wednesday, January 25, 2017 at 9:39:03 AM UTC, Le Dang Trung wrote: >>> >>> Likely the question 2 results in a non-integer and positive (perhaps >>> it's a text) number so that it violates the repeat_count. >>> >>> >>> >>> *----------------------------------------* >>> >>> *LE DANG TRUNG, PhD* >>> Chief Economist >>> [image: rta_logo] >>> >>> >>> *Real-Time Analytics*A: 1101, 11th Fl, Citilight Tower, 45 Vo Thi Sau, >>> District 1, HCMC >>> T: +84 8 6684 6530 >>> M: +84 979 344 227 >>> E: tru...@rta.vn >>> W: www.rta.vn >>> >>> >>> *Disclaimer:* >>> >>> *This message is private and confidential. If you have received this >>> message in error, please notify us and remove it from your system. Any >>> views or opinions presented here may be those of the originator and are not >>> necessarily those of Real-Time Analytics.* >>> >>> On Wed, Jan 25, 2017 at 4:34 PM, Test Isolate wrote: >>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Thank you, Anonymous Helper! >>>> >>>> When I check the xlsform page on repeats ( http://xlsform.org/#repeats >>>> ) and implement the >>>> concept there; I still get an error. Please see screenshot attached. >>>> I'm not sure if it's because I made the question that initiates the >>>> repeat group [select_one] type instead of an [integer] type..??? >>>> >>>> Thank you, >>>> >>>> Bryan >>>> (Ghana-West Africa) >>>> >>>> >>>> On Wednesday, January 25, 2017 at 2:54:14 AM UTC, tru...@rta.vn wrote: >>>>> >>>>> You can use repeat_count (look for the column in the xlsform >>>>> template). >>>>> >>>>> >>>>> On Monday, January 23, 2017 at 10:03:47 PM UTC+7, Test Isolate wrote: >>>>> > Hello Community, >>>>> > >>>>> > I need help with resolving a repeat group item in my XLSForm. >>>>> > >>>>> > Example: If the user specifies 2, I want the next question to >>>>> repeat twice and accept entries 2 times. >>>>> > I have something like this: >>>>> > >>>>> > type >>>>> name >>>>> label >>>>> repeat_count >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > select_one >>>>> > LS_number >>>>> > q2a >>>>> > 2. How many owners who refused >>>>> > are available? >>>>> > >>>>> > >>>>> > begin repeat >>>>> > repeat_group >>>>> > Owner Reason >>>>> > >>>>> > >>>>> > select_one LS_reasons >>>>> > r1 >>>>> > 2a. Why did the Owner refuse? >>>>> ${q2a} >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > end repeat >>>>> > >>>>> > I want Question 2a. to repeat based on the answer provided for >>>>> Question 2. >>>>> > But ODK allows you to add more Groups at 2a. until you choose "Do >>>>> not add". >>>>> > >>>>> > Thank you, >>>>> > Bryan >>>>> >>>>> >>>