microsoft / vsts-extension-multivalue-control

A work item form control which allows selection of multiple values.
MIT License
46 stars 44 forks source link

"Multi value Control" Extension doesn't allow multi selection for picklist #199

Closed valger-vg closed 2 years ago

valger-vg commented 2 years ago

Hi there,

I created a picklist and add multi value control based on that list. If I select more than one value I have an error The field 'MyField' contains the value 'Value1;Value2' that is not in the list of supported values. I found recommendation to use suggested values instead of allowed ones. However I don't understand what it means. Optional semicolon separated list I can't use together with text field since I can't modify it programmatically via API (or I don't know how to do it). So have to use picklist created and modifiable via API but it doesn't allow multi selection.

timritzer commented 2 years ago

The backing field for a picklist must be a single value. Thus you either have to allow custom values (and end up with Option1;Option2 as the saved value) OR not save more than one value (and end up with Option1 as the saved value.) The only alternative is to use a regular text field (and end up with "Option1;Option2" as the saved value)

This control cannot change the underlying schema/data storage which doesn't support multiple saved independent values.

Use contains searches to filter/search downstream as needed.

valger-vg commented 2 years ago

Thank you Tim. You pointed to the 'Allow a user to enter custom value'. The issue was that there are two places where this flag can be set: 'Edit control extension' and 'Edit field'. I set it only for first place since was not aware about second one. After setting this flag for the field it started to work fine. image

image image