Help with Constraint Syntax in XLS

Hi all,

I'm designing a survey in xls, and am having trouble figuring out the syntax for a constraint.

I have question that will be a Yes/No choice. If the enumerator chooses "Yes", the survey should continue as normal. If the enumerator chooses "No", a message should appear telling them that they have the wrong survey.

I know this is a very basic question, but I'm not sure what the correct phrasing should be for the constraint, and any help would be much appreciated!



Hi @Sarah_T

here is a sample form:
constraint.xls (6.5 KB)

Hi Sarah,

The skipping pattern can be configured by specifying a relevance condition for each question.

You can enter an expression into the "relevance" column to control when a field or group displays to the user (i.e., to control when it is "relevant"). The field or group will only show up to users when the expression in this column evaluates to true; otherwise, it will remain hidden. Example: ${age} < 18 means that the question/group will only be shown if the variable "age" defined before in the questionnaire is strictly less than 18.

Please find attached a more complete example.
constraint_syntax.xlsx (57.8 KB)

q2 is skipped if the answer to q1 is yes. Note that the choice is defined as yes=1 no=0. also note the use of ${} when referring to values of previously defined variables.
q3 "controls" the following questions, as it is referred in the relevant parameter of group q4_q6. If you answer yes to q3 the questions inside the group are asked, if you answer no to q3 the whole group is skipped. In the latter case (${q3}=0) a note message is displayed.

My suggestion is to have an initial screening question (similar to q3) and then all your questionnaire in a group with the appropriate "relevant" conditions.

I hope this helps.

Thanks so much, @Grzesiek2010 and @Andrea_Martin! Very helpful!