Autopopulate a multiple response question from a previous multiple question | XM Community
Skip to main content
Question

Autopopulate a multiple response question from a previous multiple question


Forum|alt.badge.img+2

I would have thought this would be a common question as hidden questions are common in other platforms in driving a survey. However, I couldn’t find a post on this so just in case anyone wants to know how to do it in Javascript. Would be useful to know how it is done in Qualtrics without Javascript.

 

    const QB = "${q://QID9/SelectedChoicesRecode}"; //read answers from multiple response question
    var result = QB.split(', ');  // convert the string answers into an array where the comma and space is the delimiter eg. “1, 2” into [“1”,”2”]
    
    if (result.includes("1")) //search in the array for code 1
    {         

                 //check the first box in a multiple response
                jQuery('input[type="checkbox"]').eq(0).prop('checked',true);        
    }
    if (result.includes("2")) ) //search in the array for code 2
    {          

                //check the second box in a multiple response
                jQuery('input[type="checkbox"]').eq(1).prop('checked',true);    
    }

3 replies

Forum|alt.badge.img+34
  • Level 4 ●●●●
  • 103 replies
  • January 24, 2024

You can use carry forward and Default choices options. if the same options list are there.


Forum|alt.badge.img+2
  • Author
  • Level 1 ●
  • 11 replies
  • January 24, 2024

I should add how to hide the question since I mentioned it although this commented on other posts. But right in saying that this has the flexibility if the codeframes are different between the two questions.

 

this.getQuestionContainer().hide();
        this.hidePreviousButton();
        this.hideNextButton();
        this.clickNextButton(); 


Forum|alt.badge.img+2
  • Author
  • Level 1 ●
  • 11 replies
  • January 28, 2024
Chhavi_Ch wrote:

You can use carry forward and Default choices options. if the same options list are there.

Hmm I tried it but this didn’t seem to work the Default just came up blank. Perhaps embedded data is a way to go? Although I don’t know how to do it for multiple answers.


Leave a Reply