getSelectedCount

Description

This function will help you to get the total number of answer options selected for a question by the respondent and use it within your script.


Syntax

$survey.$survey.getSelectedCount("Question Code")


Example Script

Consider a multiple-select choice question, the number of options selected on the question can be stored as a count under a custom variable. We can fetch the value of the count by calling out the custom variable in the survey.

arrow_rightScript

        /* get number of options selected in Q1 */
        var count = $survey.getSelectedCount("Q1");
         
        $survey.updateCustomVariable(1, count);
        

                   

Example Survey: Survey Link


Supported Question Types

  • Multiple Choice: Select One
  • Multiple Choice: Select Many
  • Multiple Choice: Drop Down
  • Basic Matrix: Multi-Point Scales
  • Basic Matrix: Checkbox/Multi-Select
  • Image Chooser: Select One
  • Image Chooser: Select Many
  • Image Chooser: Select Rating
  • Graphical Rating: Thumbs Up/Down
  • Graphical Rating: Smiley - Rating
  • Graphical Rating: Text Slider
  • Graphical Rating: Numeric Slider
  • Customer Satisfaction: Net Promoter Score
  • Data Reference: Lookup Table

Need help? Contact Us