Carry forward rankings from rank order question | XM Community
Skip to main content
Question

Carry forward rankings from rank order question


Hello, I need to do something relatively simple but I can't figure it out. I want to give participants a Rank Order question, after which I give them some information, then give them the same rank-order question to see whether they will change their rankings. The second time the question appears, I want it to carry forward their previous rankings (and give them the chance to change the order). Looking through this forum, I've seen a few similar (but more complicated) questions, with answers that say you need to use JavaScript and embedded data. For example, this question includes some suggested JavaScript: https://www.qualtrics.com/community/discussion/5880/how-to-pipe-answers-that-are-not-highestvalue-or-lowestvalue-from-a-rank-order-question ...but it doesn't say what to do after pasting that in. I've read through the Qualtrics documentation for embedded data but that only tells you how to create embedded data elements, not how to use them to save data from one question and pipe it into another.

20 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • November 4, 2019
You don't need embedded data, and you may or may not need JavaScript depending on the type of rank order question you are using. What type of rank order question are you using?

  • Author
  • 6 replies
  • November 4, 2019
I'm using a Drag and Drop rank order.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • November 4, 2019
> @Melly82 said: > I'm using a Drag and Drop rank order. If you use a Drag and Drop, you'll need to use JavaScript to put the choices in rank order. Pipe all the choices and ranks into your follow-up question, then rearrange the choices based on the ranks. You can avoid JavaScript if you use a Text Box Rank Order question and set the default answers to the ranks in the first question.

  • Author
  • 6 replies
  • November 5, 2019
Drag and Drop is ideal for our needs. Do you know where I can find the syntax for piping the choices and ranks (if I keep the Drag and Drop option)? I'm pretty new at this, and I'm happy to read through documentation, but I can't find this information anywhere.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • November 5, 2019
> @Melly82 said: > Drag and Drop is ideal for our needs. Do you know where I can find the syntax for piping the choices and ranks (if I keep the Drag and Drop option)? I'm pretty new at this, and I'm happy to read through documentation, but I can't find this information anywhere. The best way to find the piping syntax is to go to the question text of the follow-up question, click on Piped Text.. and choose the appropriate fields from the first rank order question.

  • Author
  • 6 replies
  • November 5, 2019
I don't see any options that me to pipe in items based on their previous rankings, aside from the highest and lowest. For example, in Question 1, say the participant is given these items: What about Bob Ghostbusters Groundhog Day Caddyshack ...and the participant ranks them in this order: Ghostbusters Groundhog Day What about Bob Caddyshack When creating the answer choices for Question 2, I can make the first one: ${q://QID1/ChoiceGroup/ChoiceWithLowestValue} and it will correctly display Ghostbusters in the first position (similarly, I can use Highest to put the Caddyshack in the last position). However, those are the only Piped Text options I see, and I need to know how to Pipe in the remaining options (ranked 2, 3, etc.) in the correct positions.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • November 5, 2019
> @Melly82 said: > I don't see any options that me to pipe in items based on their previous rankings, aside from the highest and lowest. For example, in Question 1, say the participant is given these items: > > What about Bob > Ghostbusters > Groundhog Day > Caddyshack > > ...and the participant ranks them in this order: > Ghostbusters > Groundhog Day > What about Bob > Caddyshack > > When creating the answer choices for Question 2, I can make the first one: ${q://QID1/ChoiceGroup/ChoiceWithLowestValue} and it will correctly display Ghostbusters in the first position (similarly, I can use Highest to put the Caddyshack in the last position). However, those are the only Piped Text options I see, and I need to know how to Pipe in the remaining options (ranked 2, 3, etc.) in the correct positions. To pipe the ranks, pick the choices' values (the items after choices' descriptions in the drop down). Once piped, they will look something like: ${q://QID1/ChoiceNumericEntryValue/1}

  • Author
  • 6 replies
  • November 7, 2019
Unfortunately, that doesn't do it. That just displays a number.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • November 7, 2019
> @Melly82 said: > Unfortunately, that doesn't do it. That just displays a number. The numbers are the ranks. You would pipe them into JavaScript and use them to reorder the choices.

  • Author
  • 6 replies
  • November 8, 2019
Ok, that sounds great... so what I'm looking for is the syntax to pipe them into Javascript (to make them appear in that order in the next question).

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • November 8, 2019
> @Melly82 said: > Ok, that sounds great... so what I'm looking for is the syntax to pipe them into Javascript (to make them appear in that order in the next question). You're looking for JavaScript code. You need to write it or have someone write it for you.

  • Author
  • 6 replies
  • November 8, 2019
I'm trying to write it myself, and I know some basic JavaScript (and several other programming languages, so I am comfortable with creating and sorting arrays and such). But what I don't know is the syntax for using JavaScript to pipe responses from a Qualtrics question, or the syntax for piping JavaScript back out into the answers for a Qualtrics question. I can't find any documentation on this.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • November 8, 2019
> @Melly82 said: > I'm trying to write it myself, and I know some basic JavaScript (and several other programming languages, so I am comfortable with creating and sorting arrays and such). But what I don't know is the syntax for using JavaScript to pipe responses from a Qualtrics question, or the syntax for piping JavaScript back out into the answers for a Qualtrics question. I can't find any documentation on this. > Put the pipe string in quotes in the JS. For example: ``` var myVar = "${e://Field/myVar}"; ```

  • 1 reply
  • November 9, 2021

Hi Melly82, I'm looking for the exact same thing as you were back then. I'm not familiar with Java Script, but do you maybe have the code you used that I could have a look at and adjust to my needs?



Forum|alt.badge.img+2
  • Level 2 ●●
  • 5 replies
  • May 30, 2023

I too am now looking for this - does anyone have some example code?

thanks

Neil 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • May 30, 2023

@maillme - You might be interested in the captureRanks function.


Forum|alt.badge.img+2
  • Level 2 ●●
  • 5 replies
  • May 30, 2023

Tom, that looks like it could help - I’ll give it a try - and if I can’t get it to work - I’ll be in touch :-)

thank you!!!


Forum|alt.badge.img
  • 1 reply
  • October 9, 2023

Are there any free resources on using this with a Text Entry rank order question format? (Considering this is a Community and not a professional consulting/tech service, I’m not looking to pay for potentially public knowledge.)

I have ~20 items and am asking people to rank up to 5, with follow-up questions referring only to the items ranked 1st and 2nd, which I’d like to pipe into the static text appearing above the follow-up questions to keep them in respondents’ mind. I’m using Survey Flow to create embedded data fields for RankedFirst and RankedSecond (ignoring the rest of the rankings given, if any).

The item ranked 1st can be taken care of with ChoiceWithLowestValue text piping in Survey Flow, and I’m trying to avoid writing 19 conditional statements for the remaining items just to capture whatever was ranked 2nd (not necessarily ChoiceWithHighestValue).

Thanks!


Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1091 replies
  • October 10, 2023
Katch wrote:

Are there any free resources on using this with a Text Entry rank order question format? (Considering this is a Community and not a professional consulting/tech service, I’m not looking to pay for potentially public knowledge.)

I have ~20 items and am asking people to rank up to 5, with follow-up questions referring only to the items ranked 1st and 2nd, which I’d like to pipe into the static text appearing above the follow-up questions to keep them in respondents’ mind. I’m using Survey Flow to create embedded data fields for RankedFirst and RankedSecond (ignoring the rest of the rankings given, if any).

The item ranked 1st can be taken care of with ChoiceWithLowestValue text piping in Survey Flow, and I’m trying to avoid writing 19 conditional statements for the remaining items just to capture whatever was ranked 2nd (not necessarily ChoiceWithHighestValue).

Thanks!

@Katch This post might help you Piping from a ranking, to a ranking - in the same order | XM Community (qualtrics.com)


Forum|alt.badge.img
  • 1 reply
  • January 28, 2025
TomG wrote:

> @Melly82 said:
> I'm using a Drag and Drop rank order.

If you use a Drag and Drop, you'll need to use JavaScript to put the choices in rank order. Pipe all the choices and ranks into your follow-up question, then rearrange the choices based on the ranks.

You can avoid JavaScript if you use a Text Box Rank Order question and set the default answers to the ranks in the first question.

Hi TomG
I too wish to do give participants a Rank Order question (Q1), after which I give them some information, then give them the same rank-order question (Q2) to see whether they will change their rankings. In Q2, I want to carry forward the participants’ previous rankings (and give them the chance to change the order).

Using a Text Box Rank Order question, how can I set the the ranking from Q1 as default answers in Q2?


Leave a Reply