How is the syntax for one selected answer where another answer must also be selected in a select_multiple question?

I want to create a constrain where if Orange is selected, Mango must also be selected. Likewise, if Mango is selected then Orange must be selected. Can anyone help how to write the syntax in XlsForm? thank you

image

1 Like

You could do the same as outlined in the image below:

In the survey tab of your xlsform:

In the choices tab of your xlsform:

Image 2

Data entry screen as seen in Enketo: when conditions are not met

Data entry screen as seen in Enketo: when conditions are met

Reference xlsform:

Constraint.xlsx (11.4 KB)

Thank you sir for the quick response. What is the syntax if:

  1. Apple must be selected,
  2. If Orange is selected, Mango must be selected.
  3. Other fruit can be selected or not
    image

In this case, try this out:

In the survey tab of your xlsform:

In the choices tab of your xlsform:

Image 2

Data entry screen as seen in Enketo: when a condition is met

Data entry screen as seen in Enketo: when a condition is met

Data entry screen as seen in Enketo: when a condition is not met

Data entry screen as seen in Enketo: when a condition is not met

Reference xlsform:

Constraint.xlsx (11.4 KB)

Thank you very much Kal_Lam … You have helped me a lot

1 Like