Can an answer be required conditionally, based on a previous response?

Dear ODK Community,

We have two questions (A_4_3_0 & A_4_3_1) within a group (A43). We put them inside a group because we want to display both questions in the same screen (we achieved this using field-list appearance). First question asks if the respondent knows how much money will he/she make. The second question asks for the amount of money. We want the latter to be required only if we have a yes as our previous response, that is why we tried the following:

required="if(selected( /actor_v1/A43/A_4_3_0 ,'yes'),'true()','false()')"

But it does not work, no matter what we choose in A_4_3_0 the answer for the next question is not required.

Is there a way to achieve this? Any help is truly appreciated.

Thanks in advance,

Victor

Use ${question name}='yes value in choices wotksheet'

··· On 25 Jan 2016 09:28, wrote:

Dear ODK Community,

We have two questions (A_4_3_0 & A_4_3_1) within a group (A43). We put
them inside a group because we want to display both questions in the same
screen (we achieved this using field-list appearance). First question asks
if the respondent knows how much money will he/she make. The second
question asks for the amount of money. We want the latter to be required
only if we have a yes as our previous response, that is why we tried the
following:

required="if(selected( /actor_v1/A43/A_4_3_0 ,'yes'),'true()','false()')"

But it does not work, no matter what we choose in A_4_3_0 the answer for
the next question is not required.

Is there a way to achieve this? Any help is truly appreciated.

Thanks in advance,

Victor

--

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.

You cannot put both questions on the same screen.

ODK Collect does not recompute the relevance (visibility) of all the
questions on a screen as data is entered into those questions. As a result,
if you have Q2 relevance (visibility) depending upon an answer to Q1, and
both are on the same screen, Q2 will be visible or hidden based upon the
initial sate of Q1 when the combined screen is shown, and it will never
display until you leave and re-enter the screen, at which point the value
of Q1 will be re-examined and the Q2 will be made visible based upon Q1s
value at that time.

··· On Mon, Jan 25, 2016 at 1:17 AM, Louis Omoya wrote:

Use ${question name}='yes value in choices wotksheet'
On 25 Jan 2016 09:28, pvicma@gmail.com wrote:

Dear ODK Community,

We have two questions (A_4_3_0 & A_4_3_1) within a group (A43). We put
them inside a group because we want to display both questions in the same
screen (we achieved this using field-list appearance). First question asks
if the respondent knows how much money will he/she make. The second
question asks for the amount of money. We want the latter to be required
only if we have a yes as our previous response, that is why we tried the
following:

required="if(selected( /actor_v1/A43/A_4_3_0 ,'yes'),'true()','false()')"

But it does not work, no matter what we choose in A_4_3_0 the answer for
the next question is not required.

Is there a way to achieve this? Any help is truly appreciated.

Thanks in advance,

Victor

--

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.

--

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.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

You cannot put both questions on the same screen.

ODK Collect does not recompute the relevance (visibility) of all the questions on a screen as data is entered into those questions. As a result, if you have Q2 relevance (visibility) depending upon an answer to Q1, and both are on the same screen, Q2 will be visible or hidden based upon the initial sate of Q1 when the combined screen is shown, and it will never display until you leave and re-enter the screen, at which point the value of Q1 will be re-examined and the Q2 will be made visible based upon Q1s value at that time.

Use ${question name}='yes value in choices wotksheet'

Dear ODK Community,

We have two questions (A_4_3_0 & A_4_3_1) within a group (A43). We put them inside a group because we want to display both questions in the same screen (we achieved this using field-list appearance). First question asks if the respondent knows how much money will he/she make. The second question asks for the amount of money. We want the latter to be required only if we have a yes as our previous response, that is why we tried the following:

required="if(selected( /actor_v1/A43/A_4_3_0 ,'yes'),'true()','false()')"

But it does not work, no matter what we choose in A_4_3_0 the answer for the next question is not required.

Is there a way to achieve this? Any help is truly appreciated.

Thanks in advance,

Victor

--

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

Thank you very much, Mitch. Now I understand why it did not work.

··· On Tuesday, January 26, 2016 at 12:50:22 PM UTC-6, Mitch Sundt wrote: > On Mon, Jan 25, 2016 at 1:17 AM, Louis Omoya wrote: > On 25 Jan 2016 09:28, wrote: