Piping text from a Loop & Merge field in another block | XM Community
Skip to main content
Solved

Piping text from a Loop & Merge field in another block

  • April 18, 2024
  • 1 reply
  • 129 views

Forum|alt.badge.img+1

Hi everyone! I would like to ask your help for this task. 

 

I have created a block with a multiple choice question and multiple answers asking participants which of following events happened to them in the last 12 months (screenshot below).

After the participants select their events, I would like to ask them some questions for one specific event taken at random from the ones they selected. Therefore, in another block I used the Loop & merge field. 

 

 

Now I’m in a new block, and I would like to use piped text to refer back to the same event, but I’m not allowed to do it because in new blocks I can’t pipe previous Loop & merge fields from previous blocks. I can’t neither create a new Loop & Merge field beacuse this would randomly pick a new item from the list (while I would like to pick the same event as before!). 

 

My question is: how can I pipe the text that I’ve created from a loop & merge in a previous block? Should I use some Embedded data in Javascript? If yes, can you show me how? 

Best answer by TomG

You can use JS to set an embedded data field in a loop question with the event displayed in the loop:

Qualtrics.SurveyEngine.addOnload(function() {
Qualtrics.SurveyEngine.setEmbeddedData("loopEvent","${lm://Field/1}");
});

 

1 reply

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • Answer
  • April 18, 2024

You can use JS to set an embedded data field in a loop question with the event displayed in the loop:

Qualtrics.SurveyEngine.addOnload(function() {
Qualtrics.SurveyEngine.setEmbeddedData("loopEvent","${lm://Field/1}");
});