Question T13190
Visible to All Users

Autocomplete a Dropdown in from other Single Input fields that the customer complete

created 2 years ago (modified 2 years ago)

[Ticket cloned from T11279: Autocomplete Dropdown from the results of API]

I was wondering if you could guide me to the correct place to know how I can autocomplete a Dropdown in a Surveyjs from other fields “Single Input” that the customer complete.

I.e.: The customer add titles Solution one, two, three and the this should appear in the dropdown below. Also, if the customer remove an option then it will disappear from the dropdown. Is it possible in survey or it has to be done coding in javascript?

Thanks in advance.

Isabel

Answers approved by surveyjs Support

created 2 years ago

Hello Isabel,
Just want to inform you that with v1.9.103 and newer, we supported copying choices from Dynamic Matrix rows. Now, you can easily configure your Dropdown question to copy choices from a Dynamic Matrix question using the following settings:

For more information, please refer to the following release note: Populate choices with values from Dynamic Matrix or Dynamic Pane.

Should you have any questions or require further assistance, we are here to help.

    Comments (2)

      Good Afternoon,

      I have been checking the website and they said that I can use the SelectedChoices to count options selected in a multiple Checkbox, but how I can write this in the survey? Has it to be javascript?

      Count  maxslectedchoices

      onPropertyChanged(question, propertyName, newValue) {
        if (propertyName == "maxSelectedChoices") {
          question.contentQuestion.maxSelectedChoices = newValue;
        }
      }

      Best,

      Isabel

      Isabel  Fabregas

      Governance Process Design Analyst, Architecture Office
      Architecture | CTO | T&O UK

      engineeringgovernanceandprocessdesign@santander.co.uk

      Do you need to print this email? Save paper, save trees.

      Emails aren't always secure, and they may be intercepted or changed after they've been sent. Santander doesn't accept liability if this happens. If you think someone may have interfered with this email, please get in touch with the sender another way. This message doesn't create or change any contract. Santander doesn't accept responsibility for damage caused by any viruses contained in this email or its attachments. Emails may be monitored. If you've received this email by mistake, please let the sender know at once that it's gone to the wrong person and then destroy it without copying, using, or telling anyone about its contents.

      Santander UK plc. Registered Office: 2 Triton Square, Regent's Place, London, NW1 3AN, United Kingdom. Registered Number 2294747. Registered in England and Wales. https://www.santander.co.uk. Telephone 0800 389 7000. Calls may be recorded or monitored. Authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority. Our Financial Services Register number is 106054. You can check this on the Financial Services Register by visiting the FCA’s website https://www.fca.org.uk/register.  Santander and the flame logo are registered trademarks.

      Ref:[PDB#1-4B]

        Hello,

        I created a separate ticket on your behalf: T14436: Use the SelectedChoices to count options selected in a multiple Checkbox. We placed it in our processing queue and will process it shortly.

        created 2 years ago

        Hello Isabel,
        Thank you for sharing the screenshot. From what I gather, you wish to populate Dropdown item list based on the Title column of a Dynamic Matrix question.

        Unfortunately, it is impossible to complete this without coding. To create Dropdown question items based on added rows and remove drop-down items when a matrix row is removed, you can use SurveyJS Form Library API methods:

        JavaScript
        survey.onMatrixRowRemoved.add((sender, options) => { let dropdownQuestion = sender.getQuestionByName('question2'); let removedRow = options.row; dropdownQuestion.choices = dropdownQuestion.choices.filter(choice => choice.value != removedRow.getValue('Col 1')); }); survey.onMatrixCellValueChanged.add((sender, options) => { let matrixType = options.question.getType(); if(matrixType === 'matrixdynamic'){ let dropdownQuestion = sender.getQuestionByName('question2'); let itemValue = new Survey.ItemValue(options.value); dropdownQuestion.choices.push(itemValue); } });

        Example.

          Comments (1)

            Thanks 

            Isabel

            Isabel  Fabregas

            Governance Process Design Analyst, Architecture Office
            Architecture | CTO | T&O UK

            engineeringgovernanceandprocessdesign@santander.co.uk