Question T16624
Visible to All Users

Merge Question Values (valueName) does not work with the built-in 'None'

created a year ago (modified a year ago)

Issue: The 'None' selection is propagated to each checkbox question with the same 'valueName'.

My need:
I need to group all selected choices from multiple checkbox questions within one property. It seems that 'valueName' property is the right way to do it (https://surveyjs.io/form-library/documentation/design-survey/merge-question-values)). I also need to have a 'None' option.

But when a 'None' choice is selected, all checkbox questions with the same 'value Name' reflect that change automatically selecting the same choice.

In the example above, I have provided a unique choice name per question to avoid such value propagation for ordinal choice. That works fine. But not for the 'None' choice, I did not find a way to set a specific name for 'None' choice.

Please advice how I can make that work, Thank you.

Example to reproduce:

JSON
{ "title": "Incorrect behavior None option with valueName", "pages": [ { "name": "page1", "elements": [ { "type": "checkbox", "name": "question1", "valueName": "mergedValue", "choices": [ { "value": "question1.item1", "text": "Item1" } ], "showNoneItem": true }, { "type": "checkbox", "name": "question2", "valueName": "mergedValue", "choices": [ { "value": "question2.item1", "text": "Item1" } ], "showNoneItem": true } ] } ], "showQuestionNumbers": "off" }
Show previous comments (6)
AT AT
Andrew Telnov a year ago

    I am sorry, but I would not agree with you on this. You can make your code generic and re-use it in different projects.
    It doesn't matter where the code is located in surveyjs packages or in your own JavaScript files. At the end it does what needs to be done.

    If we include all possible functionality in our libraries, we will make it harder for developers to use our libraries and it will be harder for us to implement new functionality or make a refactoring. Tons of API that used by couple developers (every single functionality is used by 1-3 developers and unused by tens of thousands) will not help to support the product and move it forward.
    I mean some functionality is better to have out of the box, some functionality is better to have outside the project.

    PS: I was in the business of writing libraries, mostly commercial libraries, since 1997 and I made many mistakes and learned some things :-).

    Thank you,
    Andrew
    SurveyJS Team

      It doesn't matter where the code is located in surveyjs packages or in your own JavaScript files. At the end it does what needs to be done.

      At least it is a matter of effort and the side that puts in this effort. :)

      I was in the business of writing libraries, mostly commercial libraries, since 1997

      Then, you probably agree that from the functional completence for 'one item,' (https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model#noneItem)), it is logical to have not only 'value' and 'text' but 'name' as well. And that does not cause any impact on any existing usage scenario.

      Anyway, thank you for the answers.

      AT AT
      Andrew Telnov a year ago

        You are very welcome!

        Andrew
        SurveyJS Team