Using the display condition

I am designing an application for the first time.
I have followed all the examples in the guide on the display condition but
am getting error when i deploy.
The question is a multiple choice multiple answer

What do you think is the cause of diarrhea?

  1. Flies
  2. Contaminated food
  3. Contaminated hands
  4. Others specify

I want to skip the next question which is (please specify other) in case
choice 4 is not selected. How can i go about it?

Hello Daniel,

I'd recommend checking out the documentation about the selected()
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-selected
function. Specifically, if your four option has the associated value
"other" your relevancy statement for the next question would be something
like selected(/data/multiple_choice_question, 'other')

Best,
Will

··· On Wed, Oct 21, 2015 at 7:55 AM, Daniel LUBA wrote:

I am designing an application for the first time.
I have followed all the examples in the guide on the display condition but
am getting error when i deploy.
The question is a multiple choice multiple answer

What do you think is the cause of diarrhea?

  1. Flies
  2. Contaminated food
  3. Contaminated hands
  4. Others specify

I want to skip the next question which is (please specify other) in case
choice 4 is not selected. How can i go about it?

--
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.
For more options, visit https://groups.google.com/d/optout.

Hi Daniel

We have exactly the same flow in many of our forms. I attach a screen shot
which shows how we achieve what you are wanting to achieve. We don't skip
the next question we include prompting for the 'other' specification within
a question list (in the screenshot 'Wholesaler used') is a question list
which includes the multiple choice options AND the option to specify the
'other' choice.

Simon

··· On Wednesday, October 21, 2015 at 1:55:23 PM UTC+2, Daniel LUBA wrote: > > I am designing an application for the first time. > I have followed all the examples in the guide on the display condition but > am getting error when i deploy. > The question is a multiple choice multiple answer > > What do you think is the cause of diarrhea? > 1. Flies > 2. Contaminated food > 3. Contaminated hands > 4. Others specify > > I want to skip the next question which is (please specify other) in case > choice 4 is not selected. How can i go about it? >

Build Failed!
Validation Error: Dependency cycles amongst the xpath expressions in
relevant/calculate

More information:
Error: XPath Dependency Cycle:
/data/cause_dios => /data/cause_dios
in form WASH Mini FU Survey 2015 form
https://www.commcarehq.org/a/wash-fu-mini-survey-1/apps/view/6403021d32616d50b063b2b0ca7d7a6e/modules-0/forms-0/
in module "Health, Hygiene, Water and Sanitation"

··· On Wednesday, October 21, 2015 at 2:55:23 PM UTC+3, Daniel LUBA wrote: > > I am designing an application for the first time. > I have followed all the examples in the guide on the display condition but > am getting error when i deploy. > The question is a multiple choice multiple answer > > What do you think is the cause of diarrhea? > 1. Flies > 2. Contaminated food > 3. Contaminated hands > 4. Others specify > > I want to skip the next question which is (please specify other) in case > choice 4 is not selected. How can i go about it? >

For the display condition section you are stating the conditions under
which you want the question to be displayed
(NOT the situation in which it
should skip).

For example, consider a question that asks for a cellphone number. We only
want to show that question if the answer to the previous question ("Do you
have a cellphone?") is yes.

  1. Once in the expression editor click "add expression"
  2. From the question tree, drag the "Do you have a cellphone?" question
    over to the first box until the mouse shows a green check mark- then drop
    it in.
  3. Grab the "yes" answer from the "Do you have a cellphone?" question
    and drag that into the second box.
  4. Make sure that the drop down menu between the boxes says "is equal
    to."
  5. Verify that a green "OK" box appears at the end of the expression
  6. Click "save to form"- you will see the expression now appears in the
    box next to "skip condition"

Now this question will only show when the answer to "Do you have a
cellphone?" is "Yes."

I have used the above example but the error message i get is (The Display
Condition for a question is not allowed to reference the question itself.
Please remove the . from the Display Condition or your form will have
errors.) how else can i do it.

··· On Wednesday, October 21, 2015 at 2:55:23 PM UTC+3, Daniel LUBA wrote: > > I am designing an application for the first time. > I have followed all the examples in the guide on the display condition but > am getting error when i deploy. > The question is a multiple choice multiple answer > > What do you think is the cause of diarrhea? > 1. Flies > 2. Contaminated food > 3. Contaminated hands > 4. Others specify > > I want to skip the next question which is (please specify other) in case > choice 4 is not selected. How can i go about it? >

Thanks Jeremy, let me try it.

··· On Wednesday, October 21, 2015 at 2:55:23 PM UTC+3, Daniel LUBA wrote: > > I am designing an application for the first time. > I have followed all the examples in the guide on the display condition but > am getting error when i deploy. > The question is a multiple choice multiple answer > > What do you think is the cause of diarrhea? > 1. Flies > 2. Contaminated food > 3. Contaminated hands > 4. Others specify > > I want to skip the next question which is (please specify other) in case > choice 4 is not selected. How can i go about it? >

Thanks William, i have used it but it also brings an error message.

··· On Wed, Oct 21, 2015 at 3:45 PM, William Pride wrote:

Hello Daniel,

I'd recommend checking out the documentation about the selected()
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-selected
function. Specifically, if your four option has the associated value
"other" your relevancy statement for the next question would be something
like selected(/data/multiple_choice_question, 'other')

Best,
Will

On Wed, Oct 21, 2015 at 7:55 AM, Daniel LUBA daluba2003@gmail.com wrote:

I am designing an application for the first time.
I have followed all the examples in the guide on the display condition
but am getting error when i deploy.
The question is a multiple choice multiple answer

What do you think is the cause of diarrhea?

  1. Flies
  2. Contaminated food
  3. Contaminated hands
  4. Others specify

I want to skip the next question which is (please specify other) in case
choice 4 is not selected. How can i go about it?

--
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.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-users/Hb0J9ZATEE0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hello, Daniel,

That error message often shows up if you accidentally drag the question in
which you are building the display condition into the expression builder,
instead of the question you wanted to reference. So, in your example, if
you accidentally dragged "What is your number?" (instead of "Do you have a
cellphone?") into the display condition for "What is your number?" you
would see a . instead /data/phone_number. I recommend deleting the display
condition and trying to create it again.

Hope this helps!

Jeremy

··· On Thu, Oct 22, 2015 at 3:58 AM, Daniel LUBA wrote:

For the display condition section you are stating the conditions under
which you want the question to be displayed
(NOT the situation in which
it should skip).

For example, consider a question that asks for a cellphone number. We
only want to show that question if the answer to the previous question ("Do
you have a cellphone?") is yes.

  1. Once in the expression editor click "add expression"
  2. From the question tree, drag the "Do you have a cellphone?"
    question over to the first box until the mouse shows a green check mark-
    then drop it in.
  3. Grab the "yes" answer from the "Do you have a cellphone?" question
    and drag that into the second box.
  4. Make sure that the drop down menu between the boxes says "is equal
    to."
  5. Verify that a green "OK" box appears at the end of the expression
  6. Click "save to form"- you will see the expression now appears in
    the box next to "skip condition"

Now this question will only show when the answer to "Do you have a
cellphone?" is "Yes."

I have used the above example but the error message i get is (The Display
Condition for a question is not allowed to reference the question itself.
Please remove the . from the Display Condition or your form will have
errors.) how else can i do it.

On Wednesday, October 21, 2015 at 2:55:23 PM UTC+3, Daniel LUBA wrote:

I am designing an application for the first time.
I have followed all the examples in the guide on the display condition
but am getting error when i deploy.
The question is a multiple choice multiple answer

What do you think is the cause of diarrhea?

  1. Flies
  2. Contaminated food
  3. Contaminated hands
  4. Others specify

I want to skip the next question which is (please specify other) in case
choice 4 is not selected. How can i go about it?

--
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.
For more options, visit https://groups.google.com/d/optout.

Could you post the error message you're seeing?

··· On Wed, Oct 21, 2015 at 9:24 AM, Daniel LUBA wrote:

Thanks William, i have used it but it also brings an error message.

On Wed, Oct 21, 2015 at 3:45 PM, William Pride wpride@dimagi.com wrote:

Hello Daniel,

I'd recommend checking out the documentation about the selected()
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-selected
function. Specifically, if your four option has the associated value
"other" your relevancy statement for the next question would be something
like selected(/data/multiple_choice_question, 'other')

Best,
Will

On Wed, Oct 21, 2015 at 7:55 AM, Daniel LUBA daluba2003@gmail.com wrote:

I am designing an application for the first time.
I have followed all the examples in the guide on the display condition
but am getting error when i deploy.
The question is a multiple choice multiple answer

What do you think is the cause of diarrhea?

  1. Flies
  2. Contaminated food
  3. Contaminated hands
  4. Others specify

I want to skip the next question which is (please specify other) in case
choice 4 is not selected. How can i go about it?

--
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.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-users/Hb0J9ZATEE0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.
For more options, visit https://groups.google.com/d/optout.