Piping text based on group sort | XM Community
Skip to main content

Hello,
In Q1, the participants are asked to write down 6 responses.
Q2 then asks participants to sort their responses from Q1 into two categories:
image.pngIn Q3, I would like to pipe in the responses they gave for each group:
'You said that {responseA}, {responseB}, and {responseC} were Towards.
You said that {responseD}, {responseE}, and {responseF} were Away.'
ie. be able to only show the items that were put in each group.
Is there a way to do this?
Best,
Ben

Is it important that they Rank them? As I would just go with a matrix table. From there all you use piped text: ${q://...SelectedChoicesForAnswer/1} and ${q://...SelectedChoicesForAnswer/2}.
If you require them to Rank or you feel like it is an easier experience, you will have to move the display pipes to a second block and put a whole bunch of IF logic in the Survey Flow and store the data in Embedded Data.


Thank you, MSobotta.
It doesn't need to be ranked (although I do prefer the sorting activity).
The matrix table will allow me to list the responses in each group, but not allow me to pipe them individually (i.e. {the first response in group A}, {the second response in Group A}...{the first response in group B}). I want to use the function in more elaborate ways than the examples I gave.
Is there a way to do this?


Yes, by using nested IF statements in your survey flow. Tested it myself. Here is a simplified description:
[Show Block Enter in Values and Rank Them]
// Make sure you have a page break inbetween the Entry and the Ranking OR you can put them in their own blocks

// Takes Care of Entry1
// I would recomend Groups to keep things organized
If Entry1 - Towards is Selected
Then If Entry1 - Rank = 1
Set Embedded Data: Towards1 = Entry1
Then If Entry1 - Rank = 2
Set Embedded Data: Towards2 = Entry1
...
Then If Entry1 - Rank = 6
Set Embedded Data: Towards6 = Entry1

If Entry1 - Away is Slected
Then If Entry1 - Rank = 1
Set Embedded Data: Away1 = Entry1
Then If Entry1 - Rank = 2
Set Embedded Data: Away2 = Entry1
...
Then If Entry1 - Rank = 6
Set Embedded Data: Away6 = Entry1

// Repeat for Entry2
If Entry2 - Towards is Selected
Then If Entry2 - Rank = 1
Set Embedded Data: Towards1 = Entry2
Then If Entry2 - Rank = 2
Set Embedded Data: Towards2 = Entry2
...
Then If Entry2 - Rank = 6
Set Embedded Data: Towards6 = Entry2

If Entry2 - Away is Slected
Then If Entry2 - Rank = 1
Set Embedded Data: Away1 = Entry2
Then If Entry2 - Rank = 2
Set Embedded Data: Away2 = Entry2
...
Then If Entry2 - Rank = 6
Set Embedded Data: Away6 = Entry2

//Repeat for Entries 3, 4, 5 and 6

[Show Block Display Values and Ranks]


https://community.qualtrics.com/XMcommunity/discussion/comment/42009#Comment_42009Thank you MSobatta, but I am a coding novice - where does all this go? And how do I then create the sentence: 'You said that {responseA}, {responseB}, and {responseC} were Towards' in Q3?


Survey Flow my good chap.


Leave a Reply