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.getodk.org [mailto:noreply@forum.getodk.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

What do you mean by:

any error or what?

Do you send (and then download) it from aggregate or google sheets?

Hello,

Thank you for your response. I understand I can only download images or any other media files only from gallery. I have changed the username and cell number as instructed in this step, but I am getting an error (which I have attached a screenshot of it). Please tell me where I have gone wrong.
This is my link which I have created in excel:
=HYPERLINK("https://kc.kobotoolbox.org/attachment/original?media_file=median_insights/attachments/"&B2)

This is the actual link when I clink on the image in kobotoolbox:
https://kc.kobotoolbox.org/media/original?media_file=median_insights/attachments/db3fdeb37dd546a8a204381364b9383b/a3ee67cc-bf77-4836-8e57-cb449ba902a2/1573713260170.jpg

Queries:

  1. How to download all the collected pictures from kobotoolbox and keep them in excel (one should be able to clink on the hyperlink and be able to view the picture offline)
  2. Can I reduce the camera resolution by writing any logic or it should be done in the device settings?

I followed this below mentioned step:
Download your data to XLS and open the file
In a new column next to the one that contains the filenames of your images, enter the following formula: If using the
KoBoToolbox server:
=HYPERLINK("https://kc.kobotoolbox.org/attachment/original?media_file=username/attachments/"&A2)
If using OCHA's server: =HYPERLINK("https://kc.humanitarianresponse.info/attachment/original?media_file=username/attachments/"&A2)
In the formula replace 'username' with your own username and 'A2' with the first cell reference that contains the file name of your photo. Then copy the formula down for all your records.
You can then click on each of the links to open the media file. Note: This will only work if you are signed in to your user account in your default browser.

It's a problem with Kobo so please ask here: https://community.kobotoolbox.org/