Pre-select multiple choice options based on embedded data | XM Community
Solved

Pre-select multiple choice options based on embedded data

  • 6 February 2020
  • 3 replies
  • 128 views

Userlevel 2
Badge +6
I would like our community partners to review the current information we have stored and make any needed changes. One of the questions is the type of partnership they have with us -- ranges from a level 1 - Job Fair to level 6 - Career Internship. I have embedded data "Level Number" which is one or more values based on their answer earlier this school year (ie Level Number 1,2,5,6). I am trying to pre-check the same levels when I display the data to them for their review. Searching through the community I have found some javascript code but it does not seem to be selecting any of the responses for me. I would appreciate any tips in the coding

Qualtrics.SurveyEngine.addOnload(function()
{
var val ="${e://Field/Level Number}".split(", ");
for (var i = 0; i < val.length; i++) {
this.setChoiceValueByRecodeValue(val[i],true);
}
});
icon

Best answer by MichelleM 21 February 2020, 21:25

View original

3 replies

Userlevel 5
Badge +15
I'm bookmarking this, because I'm curious too. But in the meantime, could I suggest you upvote this product idea to make this process a lot easier? https://www.qualtrics.com/community/discussion/7914/allow-for-logic-in-piped-responses-for-default-choices
Userlevel 2
Badge +6
Thanks for showing me that post @ClairJ -- definitely upvoted!!
Userlevel 2
Badge +6
I found I was able to get my code to work, as long as the attribute was coded Level Number 1, 2, 5, 6 rather than Level Number 1,2,5,6 (needs the spaces after the comma).

Leave a Reply