How do I know a value of a field in a repeated group?

Hi everyone,

I'm trying to access a specific variable nested in a repeated group. This
is because a subsequent series of questions that come later that could be
asked or not - depend on the value range that this variable holds.
Unfortunately, I don't know how to condition this to check for the value or
even where. I cannot point to a specific index in the repeated group as I
don't know which holds the value range I seek.
I'll exemplify. A repeated group holds a sequence of questions regarding
enrolled school children in a class room. Every replicated group represents
a separate child.
Among these questions, there's one that asks for the child's age.

Further on in the survey, I have a group of questions that only apply to
children if they were below 12 years of age.

How would I condition this group to execute?

Your assistance will greatly be appreciated!

Kind regards,
Ramadhan Swalleh

Hi Ramadhan,

Read this thread:

https://groups.google.com/forum/#!searchin/opendatakit/indexed-/opendatakit/daM5EDgY_JQ/qP67sv60zNYJ

Ayub

··· On Thursday, September 4, 2014 1:19:34 PM UTC+5, Ramadhan Ali Swalleh wrote: > > Hi everyone, > > I'm trying to access a specific variable nested in a repeated group. This > is because a subsequent series of questions that come later that could be > asked or not - depend on the value range that this variable holds. > Unfortunately, I don't know how to condition this to check for the value > or even where. I cannot point to a specific index in the repeated group as > I don't know which holds the value range I seek. > I'll exemplify. A repeated group holds a sequence of questions regarding > enrolled school children in a class room. Every replicated group represents > a separate child. > Among these questions, there's one that asks for the child's age. > > Further on in the survey, I have a group of questions that only apply to > children if they were below 12 years of age. > > How would I condition this group to execute? > > Your assistance will greatly be appreciated! > > Kind regards, > Ramadhan Swalleh >

Hi Ramadhan,

Read this :

https://groups.google.com/forum/#!topic/formhub-users/Ifu8KDaX1hQ

Koassi

··· Le jeudi 4 septembre 2014 08:19:34 UTC, Ramadhan Ali Swalleh a écrit : > > Hi everyone, > > I'm trying to access a specific variable nested in a repeated group. This > is because a subsequent series of questions that come later that could be > asked or not - depend on the value range that this variable holds. > Unfortunately, I don't know how to condition this to check for the value > or even where. I cannot point to a specific index in the repeated group as > I don't know which holds the value range I seek. > I'll exemplify. A repeated group holds a sequence of questions regarding > enrolled school children in a class room. Every replicated group represents > a separate child. > Among these questions, there's one that asks for the child's age. > > Further on in the survey, I have a group of questions that only apply to > children if they were below 12 years of age. > > How would I condition this group to execute? > > Your assistance will greatly be appreciated! > > Kind regards, > Ramadhan Swalleh >

Hi Ayub,

Thank you so much for the reference and your quick response!
The thread describes accessing values in a static arrays well.
However, I need the survey to automatically know if a certain group in a
repeat loop has a variable value that falls in a specific range - then
apply this condition to determine whether to execute a subsequent group of
questions. I also have no way of knowing the number of repeats in my group
so defining an upper limit is not possible.
Is what I'm asking for possible?

Please let me know?
Your assistance is greatly appreciated.

Kind regards,
Ramadhan Swalleh

··· On Thu, Sep 4, 2014 at 12:22 PM, Ayub wrote:

Hi Ramadhan,

Read this thread:

https://groups.google.com/forum/#!searchin/opendatakit/indexed-/opendatakit/daM5EDgY_JQ/qP67sv60zNYJ

Ayub

On Thursday, September 4, 2014 1:19:34 PM UTC+5, Ramadhan Ali Swalleh wrote:

Hi everyone,

I'm trying to access a specific variable nested in a repeated group. This
is because a subsequent series of questions that come later that could be
asked or not - depend on the value range that this variable holds.
Unfortunately, I don't know how to condition this to check for the value
or even where. I cannot point to a specific index in the repeated group as
I don't know which holds the value range I seek.
I'll exemplify. A repeated group holds a sequence of questions regarding
enrolled school children in a class room. Every replicated group represents
a separate child.
Among these questions, there's one that asks for the child's age.

Further on in the survey, I have a group of questions that only apply to
children if they were below 12 years of age.

How would I condition this group to execute?

Your assistance will greatly be appreciated!

Kind regards,
Ramadhan Swalleh

Koassi,

https://lh3.googleusercontent.com/-_KltRero4ew/VAlqWRzEWyI/AAAAAAAAAAg/1brnXtmOLF8/s1600/answers.png
I have attached the form (.xls) that was at the end of the URL you
attached, can we delete the blank options in that? please see above screen
shot.

Regards,
Ayub

Indexed-repeat.xls (39 KB)

Ayub,
I fear it is not possible

Koassi

··· Le vendredi 5 septembre 2014 07:47:38 UTC, Ayub a écrit : > > Koassi, > > > > I have attached the form (.xls) that was at the end of the URL you > attached, can we delete the blank options in that? please see above screen > shot. > > Regards, > Ayub >

Ayub,

I haven't looked closely, but you might be able to default those
values to Invalid or something like that and prevent the user from
proceeding if they have selected an invalid spouse.

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Fri, Sep 5, 2014 at 4:55 AM, Koassi AKAKPO akakpo.koassi@gmail.com wrote:

Ayub,
I fear it is not possible

Koassi

Le vendredi 5 septembre 2014 07:47:38 UTC, Ayub a écrit :

Koassi,

I have attached the form (.xls) that was at the end of the URL you attached, can we delete the blank options in that? please see above screen shot.

Regards,
Ayub

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yaw,

You're right, following as constraint works fine:

string-length(jr:choice-name(/data/Qestion, '/data/Qestion')) > 0

Thanks,
Ayub

Thanks guys,

I managed to implement some of the elements expressed in the attached
samples and they were very useful.
I really appreciate your assistance.

Kind regards,
Ramadhan Swalleh

··· On Sun, Sep 7, 2014 at 12:35 AM, Ayub wrote:

Yaw,

You're right, following as constraint works fine:

string-length(jr:choice-name(/data/Qestion, '/data/Qestion')) > 0

Thanks,
Ayub