# Skip questions

**URL:** <https://forum.getodk.org/t/skip-questions/4022>\
**Category:** Development\
**Created:** [February 7, 2015, 12:52pm UTC](https://forum.getodk.org/t/skip-questions/4022 "2015-02-07T12:52:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rebecca\_Chaula](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@Rebecca\_Chaula](https://forum.getodk.org/u/Rebecca_Chaula)\
**Post date:** [February 7, 2015, 12:52pm UTC](https://forum.getodk.org/t/skip-questions/4022/1 "2015-02-07T12:52:46Z")

</div>

am new using ODK, tried so many times to use relevance in odk build with no  
positive feedback,  
how do i set skipping pattern in my form (using odk build?)

I tried to write this in relevance row:  
"If answer is '2' in question Q9\_Cough then jump to Q11\_Cough"  
when I tried to run this error occured.

I need help please....

---

<div class="post-metadata">

**Author:** ![Angelo\_Lazzari](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@Angelo\_Lazzari](https://forum.getodk.org/u/Angelo_Lazzari)\
**Post date:** [February 7, 2015, 3:48pm UTC](https://forum.getodk.org/t/skip-questions/4022/2 "2015-02-07T15:48:08Z")

</div>

can you post a form example? xml or xls?

Thanks  
Angelo

> **···**
>
> Il giorno Sat Feb 07 2015 at 13:52:48 Rebecca Chaula \< chaularebecca@gmail.com\> ha scritto:
> 
> > am new using ODK, tried so many times to use relevance in odk build with  
> > no positive feedback,  
> > how do i set skipping pattern in my form (using odk build?)
> > 
> > I tried to write this in relevance row:  
> > "If answer is '2' in question Q9\_Cough then jump to Q11\_Cough"  
> > when I tried to run this error occured.
> > 
> > I need help please....
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "ODK Developers" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [opendatakit-developers+unsubscribe@googlegroups.com](mailto:opendatakit-developers+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Saduma](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@Saduma](https://forum.getodk.org/u/Saduma)\
**Post date:** [February 9, 2015, 5:30am UTC](https://forum.getodk.org/t/skip-questions/4022/3 "2015-02-09T05:30:40Z")

</div>

Hi Rebecca  
under relevance in Q11, write this

${var Q11}=2

where var Q11 is the variable you have used for question 11 and 2 is the  
value input for question 9 (2 can be an option being selected in the  
choices)

Share your xls form if you can.

> **···**
>
> On Saturday, February 7, 2015 at 3:52:46 PM UTC+3, Rebecca Chaula wrote: \> \> \> am new using ODK, tried so many times to use relevance in odk build with \> no positive feedback, \> how do i set skipping pattern in my form (using odk build?) \> \> I tried to write this in relevance row: \> "If answer is '2' in question Q9\_Cough then jump to Q11\_Cough" \> when I tried to run this error occured. \> \> \> I need help please.... \>

---

<div class="post-metadata">

**Author:** ![Mitch\_S](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@Mitch\_S](https://forum.getodk.org/u/Mitch_S)\
**Post date:** [February 9, 2015, 6:11pm UTC](https://forum.getodk.org/t/skip-questions/4022/4 "2015-02-09T18:11:11Z")

</div>

Hi Rebecca,

Please use the opendatakit@ list for questions about using the software.  
This list (opendatakit-developers@) is for people writing the software.

The constraint and relevance expressions are not english-language  
expressions.

They are formulas written in the javarosa expression language.

This is largely documented here:

> **[Form Logic](https://docs.getodk.org/form-logic/)**
>
> ODK Collect supports a wide range of dynamic form behavior. This document covers how to specify this behavior in your XLSForm definition. Form logic building blocks: Variables: Variables reference ...

If you write forms in Excel and use the XLSForm tool, you would express  
fields using the ${fieldname} syntax.  
If you are using Build, you would write the expressions in the form used in  
the underlying XML.

The underlying XML syntax to refer to a field is either an absolute  
reference:  
/data/pathtofield/fieldname  
or a relative reference, where "." refers to the current fieldname and ".."  
refers to the parent of the current fieldname.

The 'pathtofield' is a slash/separated list of enclosing groups and repeat  
groups.

In general, you should avoid using an absolute reference to a field within  
a repeat group. The only exception is when using the indexed-repeat()  
function.

If you have 3 fieldnames, 'q1', 'q2' and 'q3', with 'q3' being within a  
group 'g', then the absolute references for these are:

/data/q1  
/data/q2  
/data/g/q3

If you wanted a constraint on the value of q2 such that it has the value  
'red' if the answer to q1 is 'green' then you could write (for the  
constraint on q2):

/data/q1 != 'green' or . = 'red'

This could also be written as

../q1 != 'green' or . = 'red'

If you wanted a constraint on q3 so that it did not match either of the  
answers for q1 or q2, you would write:

. != /data/q1 and . != /data/q2

Or, using relative paths,

. != ../../q1 and . != ../../q2

> **···**
>
> -------- Mitch
> 
> On Sun, Feb 8, 2015 at 9:30 PM, Saduma [sirahimahs@gmail.com](mailto:sirahimahs@gmail.com) wrote:
> 
> > Hi Rebecca  
> > under relevance in Q11, write this
> > 
> > ${var Q11}=2
> > 
> > where var Q11 is the variable you have used for question 11 and 2 is the  
> > value input for question 9 (2 can be an option being selected in the  
> > choices)
> > 
> > Share your xls form if you can.
> > 
> > On Saturday, February 7, 2015 at 3:52:46 PM UTC+3, Rebecca Chaula wrote:
> > 
> > > am new using ODK, tried so many times to use relevance in odk build with  
> > > no positive feedback,  
> > > how do i set skipping pattern in my form (using odk build?)
> > > 
> > > I tried to write this in relevance row:  
> > > "If answer is '2' in question Q9\_Cough then jump to Q11\_Cough"  
> > > when I tried to run this error occured.
> > > 
> > > I need help please....
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "ODK Developers" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [opendatakit-developers+unsubscribe@googlegroups.com](mailto:opendatakit-developers+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Mitch Sundt  
> Software Engineer  
> University of Washington  
> [mitchellsundt@gmail.com](mailto:mitchellsundt@gmail.com)
