Question T5988
Visible to All Users

Please suggest multi select property for questions

created 4 years ago (modified 4 years ago)

Hello Team,

Need your input on below requirement-

Designer experience- Add question with properties, one property to choose multiple Asset template(Printer, Laptop, thermometer etc)
and based on selected template load all asset properties(Model number, is Working, RAM size, temperature, last serviced etc ) in another multi choose property and here User can select multiple properties.
Since property has its own type(number, string, boolean, date etc), Name and guid Id.
Questions based on property type will be adding on designer surface for selected properties.

Runtime experience- Loading survey/inspection for any selected Asset(e.g.Printer-123abc) Render only supporting properties as questions for (Model number, is Working and last serviced) and RAM and temperature will be hidden on runtime because these are not supporting by printer asset.

We also came across some approach So in designer we are planning to user panel question along with two new custom properties(Multi choose) 1- Asset template 2- Properties

Sharing screen shot for multi choose property which we are looking for. Please let us know if surveyjs already support such multi select property
Clipboard-File-1.png

and will also add visibleIf expression for each chosen properties(question) and we will also add one hidden question of type multi choose
and in during runtime hidden question choices will be updated with selected Asset(Printer123abc) so that expression for each properties(question) can validate Asset list and display only question(property) which match with hidden question's choices.

e.g.
"type": "text",
"name": "question2",
"visibleIf": "{question1} anyof ['item2', 'item1']"

Here question question2 is selected property(Moden number) and queston1 is hidden question

Please let me know if you need more info.

Suggestions are welcome.

Thanks in advance.

Regards,
Nitin

Answers approved by surveyjs Support

created 4 years ago

Hello Nitin,
I would create a new composite component that would handle all of it. It can have some it's own properties.
Regarding the second question. You are showing select2 widget. We have the example of using it.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (11)

      Hello,

      Sorry for our mistake. The 3) component questions already implemented in SurveyPDF via this commit. Here is live sample in plunker how to export component question from this example on our site to PDF

      Clipboard-File-1.png

      Clipboard-File-2.png

      Thanks, Alex
      SurveyJS Team

        Hi Andrew,

        Our scenario is different where questions are adding dynamically in composite question.
        And for added question if user mark required then this will hard to know with same json in runtime that which question is required and which is not inside composite question.

        https://plnkr.co/edit/45HBxOs15hQ1ADk0

        Here in plunkr example, question is adding in content panel and we can mark same question required but json does not have this info.

        And one more thing in our scenario user can select n items in asset properties so composite question should also include n sub question into it.
        and user can mark few questions required and few not required.

          Here is the working example.
          In this example, I create a question. You can optionally have questions invisible and then make it visible/requires based on properties.

          Thank you,
          Andrew
          SurveyJS Team