Information on customized codes to use in the "select many" option

Hello! I needed a support regarding the Select Many option in the Kobotoolbox
I want to include a question where one can select many options but it has to be any 5 options. I want to restrict the selection after 5 marks. What would be the code to do that. Thanks

Hi @tajwargrc and welcome to the community!

If you are using Form Builder, you can click validation criteria and add this: count-selected(.) <= 5

In the XLSForm, you can use the same code under the constraint column.

Note that this will allow user to select up to 5 answers. If you want to restrict it to 5 answers only (not more not less) you need to change the code to count-selected(.) = 5

1 Like

Thanks @hakan_cetinkaya !

2 Likes

@hakan_cetinkaya, :bowing_man:

1 Like