Autopunching Rank and Carry-Forward Option – Ranking Question Skipped Due to Only 1 Option Selected | XM Community
Skip to main content
Question

Autopunching Rank and Carry-Forward Option – Ranking Question Skipped Due to Only 1 Option Selected

  • August 16, 2023
  • 8 replies
  • 76 views

Forum|alt.badge.img+1

This is a situation that we run into a lot.  We have an extremely inefficient way to resolve this, so I am hoping that someone has a suggestion that works better.

 

Here is the scenario:

  • QID1 is a “Select All” Question, with an “Other” choice with a text box
  • QID 2 is a “Rank Order” question that carries forward the selected responses
  • If only one choice is picked for QID1, QID 2 is skipped.

What we are trying to do:

  • When only 1 choice is selected, we want the choice to populate QID2.  In addition, we want the rank for that choice populate with a 1.
  • We want the rank to populate the “Other-text” rank field, instead of just the “Other” rank field.

 

Any assistance would be greatly appreciated.  Thanks!

8 replies

rgupta15
Level 4 ●●●●
Forum|alt.badge.img+8
  • Level 4 ●●●●
  • 92 replies
  • August 16, 2023

Try this,

var QID1_val=’’ #pipe in selected choices from qid1

var qid1=QID1_val.split(‘,’)

if(qid1.length==1)

{

jQuery(‘input[type=”text”]’).val(qid1)

jQuery(‘#NextButton’).click();

}


Forum|alt.badge.img+1
  • Author
  • Level 2 ●●
  • 5 replies
  • August 16, 2023

Dumb question - still fairly new to Java Script - Does the piped in selected choices (I assume ${q://QID1/ChoiceGroup/SelectedChoices}) need to be in quotes?  Sorry, I’m getting errors.


Forum|alt.badge.img+1
  • Author
  • Level 2 ●●
  • 5 replies
  • August 21, 2023

@rgupta15  Dumb question - still fairly new to Java Script - Does the piped in selected choices (I assume ${q://QID1/ChoiceGroup/SelectedChoices}) need to be in quotes?  Sorry, I’m getting errors.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • August 21, 2023

@SARVAN,

You might be interested in the skipFollowUp function. It does exactly what you want and works with any format of ranking question as well as multiple choice, constant sum and PGR questions with little to no configuration (and no piping).


Forum|alt.badge.img+1
  • Author
  • Level 2 ●●
  • 5 replies
  • August 21, 2023

@SARVAN,

You might be interested in the skipFollowUp function. It does exactly what you want and works with any format of ranking question as well as multiple choice, constant sum and PGR questions with little to no configuration (and no piping).

I’ll give that a whirl, @TomG .  Thanks!


Forum|alt.badge.img+1
  • Author
  • Level 2 ●●
  • 5 replies
  • August 21, 2023

@TomG Unfortunately it did not work. 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • August 21, 2023

@TomG Unfortunately it did not work. 

That’s because you don’t have the skipFollowUp function code. As the page linked indicates, you would need to contact me by private message.


Forum|alt.badge.img+1
  • Author
  • Level 2 ●●
  • 5 replies
  • August 21, 2023

Ahhhh..  makes sense