Xlsform repeat : display question based on value of previous iterations

Hi All,

Am trying to implement a repeat in xlsform where a particular question should not be asked again in subsequent repeats if the answer is true in the current repeat. Any ideas on how to approach this will be greatly appreciated.

Thanks

Hello Daniel,
Don't think this is possible. I try to reduce any complicated logic before (or during :-)) building a form, but certainly interested if anyone knows how to implement. May be easier to ask the particular question before the repeat?

··· On Tuesday, August 2, 2016 at 3:47:58 PM UTC-4, daniel...@gmail.com wrote: > Hi All, > > Am trying to implement a repeat in xlsform where a particular question should not be asked again in subsequent repeats if the answer is true in the current repeat. Any ideas on how to approach this will be greatly appreciated. > > Thanks

I tried my hand at this and my conclusion is that this is not currently
possible, because ODK Validate detects a circular reference when you try to
do this with indexed-repeat.

PS In case anybody is interested, this would be a much easier way to do
this in pure XPath 1.0 with the preceding-sibling axis (which is not
supported in ODK and therefore won't pass ODK Validate, but is a valid
XForm and (unofficially) works in
Enketo): https://gist.githubusercontent.com/MartijnR/432da4c84ee876ff7b240814c859f0bf/raw/886a566ff4d17c8d7fc1acb4dbdc3e5a4a38bbdc/repeat-do-not-ask-again.xml

··· On Wednesday, August 3, 2016 at 6:02:19 PM UTC-6, vi...@caribbeangis.com wrote: > > On Tuesday, August 2, 2016 at 3:47:58 PM UTC-4, daniel...@gmail.com wrote: > > Hi All, > > > > Am trying to implement a repeat in xlsform where a particular question > should not be asked again in subsequent repeats if the answer is true in > the current repeat. Any ideas on how to approach this will be greatly > appreciated. > > > > Thanks > > Hello Daniel, > Don't think this is possible. I try to reduce any complicated logic before > (or during :-)) building a form, but certainly interested if anyone knows > how to implement. May be easier to ask the particular question before the > repeat?

Thanks Vijay and Martin.
Very much appreciate your help. @ Martin , i will check out on the
attached link..

Regards

··· On Thu, Aug 4, 2016 at 9:27 PM, Martijn van de Rijdt wrote:

I tried my hand at this and my conclusion is that this is not currently
possible, because ODK Validate detects a circular reference when you try to
do this with indexed-repeat.

PS In case anybody is interested, this would be a much easier way to do
this in pure XPath 1.0 with the preceding-sibling axis (which is not
supported in ODK and therefore won't pass ODK Validate, but is a valid
XForm and (unofficially) works in Enketo):
https://gist.githubusercontent.com/MartijnR/432da4c84ee876ff7b240814c859f0bf/raw/886a566ff4d17c8d7fc1acb4dbdc3e5a4a38bbdc/repeat-do-not-ask-again.xml

On Wednesday, August 3, 2016 at 6:02:19 PM UTC-6, vi...@caribbeangis.com wrote:

On Tuesday, August 2, 2016 at 3:47:58 PM UTC-4, daniel...@gmail.com wrote:

Hi All,

Am trying to implement a repeat in xlsform where a particular question
should not be asked again in subsequent repeats if the answer is true in
the current repeat. Any ideas on how to approach this will be greatly
appreciated.

Thanks

Hello Daniel,
Don't think this is possible. I try to reduce any complicated logic
before (or during :-)) building a form, but certainly interested if anyone
knows how to implement. May be easier to ask the particular question before
the repeat?

--
Revolutionizing data collection since 2012.

Enketo https://enketo.org/ | LinkedIn
http://www.linkedin.com/company/enketo-llc | GitHub
https://github.com/enketo | Twitter https://twitter.com/enketo
| Blog http://blog.enketo.org/