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('inputptype="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);
}