Pre-select multiple choice options based on embedded data | XM Community
Skip to main content
Solved

Pre-select multiple choice options based on embedded data

  • February 6, 2020
  • 3 replies
  • 207 views

MichelleM
Level 2 ●●
Forum|alt.badge.img+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); } });

Best answer by MichelleM

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).
View original

3 replies

ClairJ
Level 4 ●●●●
Forum|alt.badge.img+15
  • Level 4 ●●●●
  • 218 replies
  • February 11, 2020
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

MichelleM
Level 2 ●●
Forum|alt.badge.img+6
  • Author
  • Level 2 ●●
  • 36 replies
  • February 11, 2020
Thanks for showing me that post @ClairJ -- definitely upvoted!!

MichelleM
Level 2 ●●
Forum|alt.badge.img+6
  • Author
  • Level 2 ●●
  • 36 replies
  • Answer
  • February 21, 2020
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