Limit selections in a multi-select list

Hello to all,
is there a way to limit the number of selections from a multi-select list?

For example, in a list of 10 choices I would like to allow 4 different choices.

I tried to use a validation formula like this:

thisrow.column.count() < 5

but without success, i get an error of circular reference.

Any help will be appreciated.
Thanks!

did you have a look at this solution from @Scott_Collier-Weir :slight_smile:

this might be it. cheers, Christiaan

1 Like

Hey there!

I have the same question.

I need people to answer a form and select only 3 choices from a “select list” of 20 options.

hi @Guilherme_Latt ,

put a filter in the relations via options, like I describe in this blog about languages, it will work for all sorts of related selections.

cheers, christiaan

Hello Chriariaan, thank you so much for your reply, I really liked this new way of thinking out a form.

My problem is a little bit different.

I require my team to answer a form choosing only 3 items in the seletc list. I have a list of 20 options and they must be able to see all of them but are required to pick only 3. The way the form and the column configuration works, when you “allow multiple selection” on a “select list” column configuration, it’s possible to select from 1 to all the options available.
I need to limit this selection to only 3.
Unfortunatly filtering the list won’t work (I believe) since filters “hide” what you don’t want to appear but it’s a great solution to other problems I have in other forms. Once again, thank you so much for this article!

hi @Guilherme_Latt ,

in a form you can set the question as required and next you can set the condition
here you have to set the condition that the count of the items is 3,
I wrote about a more complex setting in this blog

I hope it helps, cheers, christiaan

Hello @Guilherme_Latt ,

When validating input, you can’t use the current field in the validation formula, because that results in a circular reference. But with one helper column, you can do exactly what you want (if I understand your needs correctly).

Even though you can enter more choices than allowed, you will get an error upon leaving the formfield (or submitting the form) and you have to correct the number of choices.

It is a little bit buggy, but I am sure Coda will fix that. Make sure you read the notes I put in the document.

Edit: the buggy behavior has been resolved - this works as you would expect now.

2 Likes

My demo doc was a little buggy, but Coda has since fixed the buggy behavior.

1 Like