Restricting a certain choice in a variable

Hi,

I am trying to restrict a certain choice in a select_multiple variable. For example: One of the variables choices include

  1. Burnt connecting wire
  2. Burnt electronic items
  3. Loss of HH items
  4. No damage was done
  5. Any other specify
    In this above example, if any one of the or all of (1 or 2 or 3 or 5) the choices selected, the 4th choice (No damage was done) cannot be selected. Please guide me how to deal with this type of variable.

Regards,
Kiran

Hi @Kiran

Constraints is what you need! Please take a look at the doc and let us know if you need more help.

Hi @Kiran

You can add a constraint to your select_multiple question in this form:

if(selected(.,'No_damage_was_done'),count-selected(.)=1,count-selected(.)>=1)

to prevent user selecting 'No damage was done' with any of the other choices.

Regards,

1 Like

Hello,

Thank you for your quick reply. I will try this formula and
check.

Regards,

Kiran

From:
noreply@forum.opendatakit.org [mailto:noreply@forum.opendatakit.org]

Hello @Kiran,

Similar approach to what @rassam proposed, you could simplify it by using this constraint pattern:

not(selected(.,'4') and count-selected(.)>1) which limits the use of fourth item to a single selection

Happy ODKing,

Jules R

1 Like

Hi,

Thank you so much for your response. Meanwhile I also have one more query, I am able to capture the pictures and able to download to xls,cvs but I am not able to view those taken picutre (It is just saved in .jpg format). Please tell me how to view them.

Regards,
Kiran

Hi@jules_rugwiro,

Thank you so much.

Regards,
Kiran