Help needed on display logic

Hi,

I am new to xpath and not familiar with the syntax. I’m sure what I’m
trying to do isn’t that complicated but I can’t get it to work! I’m hoping
someone more experienced can point out my error.

I want to display a question only if two sets of conditions are met:

1 - Total score on a set of 20 questions is greater than 13 - i have done a
data node for this (data/calc_srq_score) and this part is working fine
OR
2 - answer on question data/consent/srq/srq17 is ''1" AND questions
data/consent/suicide_questions/suicide1,
data/consent/suicide_questions/suicide2 and
data/consent/suicide_questions/suicide3 are all ‘NO’ - it’s this that
doesn’t seem to be working.

Here is what I have programmed (the latest in a long line of tries!)

/data/calc_srq_score > 13 or (/data/consent/srq/srq17 = ‘1’ and
/data/consent/srq/suicide_questions/suicide2 = ‘no’ and
/data/consent/srq/suicide_questions/suicide1 = ‘no’ and
/data/consent/srq/suicide_questions/suicide3 = ‘no’)

What have I done wrong?!

Thanks in advance for your help!

Jenny

Jenny,

Your XPath expression looks correct to me. One good way to help debug these
issues is to look at how the form looks when submitted to HQ. Do you have a
form submission in your domain we can look at to see whether there’s
something inconsistent in the form data?

-Clayton

··· On Tue, Feb 5, 2013 at 3:57 AM, Jennifer Hall wrote:

Hi,

I am new to xpath and not familiar with the syntax. I’m sure what I’m
trying to do isn’t that complicated but I can’t get it to work! I’m hoping
someone more experienced can point out my error.

I want to display a question only if two sets of conditions are met:

1 - Total score on a set of 20 questions is greater than 13 - i have done
a data node for this (data/calc_srq_score) and this part is working fine
OR
2 - answer on question data/consent/srq/srq17 is ''1" AND questions
data/consent/suicide_questions/suicide1,
data/consent/suicide_questions/suicide2 and
data/consent/suicide_questions/suicide3 are all ‘NO’ - it’s this that
doesn’t seem to be working.

Here is what I have programmed (the latest in a long line of tries!)

/data/calc_srq_score > 13 or (/data/consent/srq/srq17 = ‘1’ and
/data/consent/srq/suicide_questions/suicide2 = ‘no’ and
/data/consent/srq/suicide_questions/suicide1 = ‘no’ and
/data/consent/srq/suicide_questions/suicide3 = ‘no’)

What have I done wrong?!

Thanks in advance for your help!

Jenny


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/groups/opt_out.

Clayton,

Sorry, I’m not sure I understand the question?! There are forms that have
been submitted using this logic - all done by me and all in the last few
days (the app hasn’t gone ‘live’ yet).

Would be great if you could take a look.

Thanks

jenny

··· On Tuesday, February 5, 2013 7:07:34 PM UTC+2, Clayton Sims wrote: > > Jenny, > > Your XPath expression looks correct to me. One good way to help debug > these issues is to look at how the form looks when submitted to HQ. Do you > have a form submission in your domain we can look at to see whether there's > something inconsistent in the form data? > > -Clayton > > On Tue, Feb 5, 2013 at 3:57 AM, Jennifer Hall <jenny_...@yahoo.co.uk wrote: > >> Hi, >> >> I am new to xpath and not familiar with the syntax. I'm sure what I'm >> trying to do isn't that complicated but I can't get it to work! I'm hoping >> someone more experienced can point out my error. >> >> I want to display a question only if two sets of conditions are met: >> >> 1 - Total score on a set of 20 questions is greater than 13 - i have done >> a data node for this (data/calc_srq_score) and this part is working fine >> OR >> 2 - answer on question data/consent/srq/srq17 is ''1" AND questions >> data/consent/suicide_questions/suicide1, >> data/consent/suicide_questions/suicide2 and >> data/consent/suicide_questions/suicide3 are all 'NO' - it's this that >> doesn't seem to be working. >> >> Here is what I have programmed (the latest in a long line of tries!) >> >> /data/calc_srq_score > 13 or (/data/consent/srq/srq17 = '1' and >> /data/consent/srq/suicide_questions/suicide2 = 'no' and >> /data/consent/srq/suicide_questions/suicide1 = 'no' and >> /data/consent/srq/suicide_questions/suicide3 = 'no') >> >> What have I done wrong?! >> >> Thanks in advance for your help! >> >> Jenny >> >> -- >> 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-user...@googlegroups.com . >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > >

Hi Jenny,

Sorry about the confusion. I think Clayton was just asking if you could
tell us your project space name and the app/form you’re having trouble with
so we can take a closer look.

Cory

··· On Thu, Feb 7, 2013 at 10:06 AM, Jennifer Hall wrote:

Clayton,

Sorry, I’m not sure I understand the question?! There are forms that have
been submitted using this logic - all done by me and all in the last few
days (the app hasn’t gone ‘live’ yet).

Would be great if you could take a look.

Thanks

jenny

On Tuesday, February 5, 2013 7:07:34 PM UTC+2, Clayton Sims wrote:

Jenny,

Your XPath expression looks correct to me. One good way to help debug
these issues is to look at how the form looks when submitted to HQ. Do you
have a form submission in your domain we can look at to see whether there’s
something inconsistent in the form data?

-Clayton

On Tue, Feb 5, 2013 at 3:57 AM, Jennifer Hall jenny_...@yahoo.co.ukwrote:

Hi,

I am new to xpath and not familiar with the syntax. I’m sure what I’m
trying to do isn’t that complicated but I can’t get it to work! I’m hoping
someone more experienced can point out my error.

I want to display a question only if two sets of conditions are met:

1 - Total score on a set of 20 questions is greater than 13 - i have
done a data node for this (data/calc_srq_score) and this part is working
fine
OR
2 - answer on question data/consent/srq/srq17 is ''1" AND questions
data/consent/suicide_**questions/suicide1, data/consent/suicide_**questions/suicide2
and data/consent/suicide_**questions/suicide3 are all ‘NO’ - it’s this
that doesn’t seem to be working.

Here is what I have programmed (the latest in a long line of tries!)

/data/calc_srq_score > 13 or (/data/consent/srq/srq17 = ‘1’ and
/data/consent/srq/suicide_**questions/suicide2 = ‘no’ and
/data/consent/srq/suicide_**questions/suicide1 = ‘no’ and
/data/consent/srq/suicide_**questions/suicide3 = ‘no’)

What have I done wrong?!

Thanks in advance for your help!

Jenny


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-user…@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.


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/groups/opt_out.

Hey,

Hi Jenny,

Sorry about the confusion. I think Clayton was just asking if you could
tell us your project space name and the app/form you’re having trouble with
so we can take a closer look.

Actually, send this information to commcarehq-support@dimagi.com (or report
an issue directly from your app page on HQ) and we’ll follow up.

Cory

··· On Thu, Feb 7, 2013 at 10:09 AM, Cory Zue wrote:

Cory

On Thu, Feb 7, 2013 at 10:06 AM, Jennifer Hall jenny_hall33@yahoo.co.ukwrote:

Clayton,

Sorry, I’m not sure I understand the question?! There are forms that have
been submitted using this logic - all done by me and all in the last few
days (the app hasn’t gone ‘live’ yet).

Would be great if you could take a look.

Thanks

jenny

On Tuesday, February 5, 2013 7:07:34 PM UTC+2, Clayton Sims wrote:

Jenny,

Your XPath expression looks correct to me. One good way to help debug
these issues is to look at how the form looks when submitted to HQ. Do you
have a form submission in your domain we can look at to see whether there’s
something inconsistent in the form data?

-Clayton

On Tue, Feb 5, 2013 at 3:57 AM, Jennifer Hall jenny_...@yahoo.co.ukwrote:

Hi,

I am new to xpath and not familiar with the syntax. I’m sure what I’m
trying to do isn’t that complicated but I can’t get it to work! I’m hoping
someone more experienced can point out my error.

I want to display a question only if two sets of conditions are met:

1 - Total score on a set of 20 questions is greater than 13 - i have
done a data node for this (data/calc_srq_score) and this part is working
fine
OR
2 - answer on question data/consent/srq/srq17 is ''1" AND questions
data/consent/suicide_**questions/suicide1, data/consent/suicide_**questions/suicide2
and data/consent/suicide_**questions/suicide3 are all ‘NO’ - it’s this
that doesn’t seem to be working.

Here is what I have programmed (the latest in a long line of tries!)

/data/calc_srq_score > 13 or (/data/consent/srq/srq17 = ‘1’ and
/data/consent/srq/suicide_**questions/suicide2 = ‘no’ and
/data/consent/srq/suicide_**questions/suicide1 = ‘no’ and
/data/consent/srq/suicide_**questions/suicide3 = ‘no’)

What have I done wrong?!

Thanks in advance for your help!

Jenny


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-user…@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.


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/groups/opt_out.