Hi all, in Q10, I ask respondents to select three issue areas they feel particularly passionate about for the upcoming election. Based on their responses, I want to populate three sliders in the next question to get the respondents ideology on each issue area they selected. As such, I need to pipe the answers from the Q10 multiselect to the Q11 slider labels. However, my code for this does not seem to be working at all. I have included a page break between the questions.
I would appreciate any help you all can provide!
Qualtrics.SurveyEngine.addOnReady(function()
{
  // Mapping from choices to slider labels
    var labelMapping = {
        'Abortion / reproductive rights': ['Pro-choice', 'Pro-life'],
        'Gun policy': ['Anti-gun', 'Pro-gun'],
        'Education': ['Public solutions', 'Private solutions'],
        'Healthcare': ['Universal healthcare', 'Private healthcare'],
        'Environmental policy / climate change': ['Aggressive regulation', 'Limited regulation'],
		'Immigration': ['Open borders', 'Restricted immigration'],
        'Size and scope of the federal government': ['Larger government with more services', 'Smaller government with fewer services'],
    };
	var policy_issues = "${q://QID10/ChoiceGroup/SelectedChoices}".split(',')
	console.log("Selected policy issues:", policy_issues);
	console.log("Type of policy_issues:", typeof policy_issues);
	// Loop through each selected issue and set slider labels
    policy_issues.forEach((issue, index) => {
        var trimmedIssue = issue.trim(); // Trim any extra whitespace
        var labels = labelMapping[trimmedIssue];
        if (labels) {
            // Target the appropriate slider using .eq(index)
            jQuery(".statement-container div").eq(index).append(labels[0]);	
            jQuery("#" + this.questionId + " .statement-container div").eq(index).append(" <span style='float:right;'>" + labels[1] + "</span>");
        }
    });
});
Qualtrics.SurveyEngine.addOnload(function()
{
   	/*Place your JavaScript here to run when the page loads*/
	// hide numbers
	jQuery("ul.numbers").hide();
	// remove tick marks
  	jQuery("#"+this.questionId+" ul.numbers li").each(function() { this.innerHTML = this.innerHTML.replace("-",""); });
  	// Remove default slider label text
    jQuery("#" + this.questionId + " .statement-container div").each(function() {
        // Find the label within the current statement container
        var defaultText = jQuery(this).find("label");
        // If a label is found, clear its text
        if (defaultText.length > 0) {
            defaultText.text("");  // Clears the default text
        }
    });
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
	/*Place your JavaScript here to run when the page is unloaded*/
});
