Record loop order of Loop&Merge question | XM Community
Solved

Record loop order of Loop&Merge question

  • 14 December 2020
  • 6 replies
  • 265 views

Hi everyone,
In my survey I set up 5 Loop&Merge fields, containing 8 images each. My survey logic will display only one Loop&Merge field to each participant. The issue is that I would like to present the 8 images of each Field in random order, but I also need to know the order in which each image is displayed. Unfortunately, Qualtrics does not export this information, is there a way I could access it?
Thanks so much for your help!

icon

Best answer by ahmedA 14 December 2020, 23:02

View original

6 replies

Userlevel 7
Badge +21

From what I understand, you have set up loop and merge in a way that a person will see 8 images. The 4 other fields are meta data.
If this is the case, then one way to go about it would be, to create an embedded variable which tracks the display order. Create a loop and merge field which is a unique identifier for each image. Something like Field 6 (img1, img2 ...). Add the following JS to the loop and merge question:
Qualtrics.SurveyEngine.addOnReady(function()
{
    var_name = "${lm://Field/6}" + "_display_order";
    Qualtrics.SurveyEngine.setEmbeddedData(var_name,"${lm://CurrentLoopNumber}");
});
This will create 8 embedded variables with names (img1_display_order, img2_display_order etc.). Their values will be from 1 to 8 indicating when the order in which they were displayed to the participants.

Hi ahmedA, thank you so much for your reply--I really appreciate it. Unfortunately, what you suggest did not solve my problem, but perhaps it is because I did not explain my issue correctly... I have 5 Fields in my Loop&Merge question. Each of these 5 Fields contains a different list of 8 images. I previously set up a display logic so that each participant will see only one Field-- corresponding to a list.
Following your suggestion, I created an embedded data called 'var_name', added your script to the Loop&Merge question and created Field 6 identifying each variable. However, the 'var_name' column is empty in the export. Any suggestion about why this might be the case would be welcome!

Userlevel 7
Badge +21

Okay. So then you are doing it wrong.
Don't create 5 fields, create 5 blocks. Each containing 8 images of the loop and merge set. But these blocks in a randomizer and select to display only one.
Then run and see, you should get the desired results.

Userlevel 7
Badge +21

Here's a demo you can look at: https://iima.au1.qualtrics.com/jfe/preview/SV_0rBGUxfJtsfN70N?Q_CHL=preview&Q_SurveyVersionID=current
Take it a few times and you'll see what I mean.
And the attached QSF for your reference.
Loop_and_Merge_Demo.qsf

ahmedA your demo works wonderfully! Thank you so much 🙏

Badge

https://community.qualtrics.com/XMcommunity/discussion/comment/32644#Comment_32644hello ahmedA !
I am sorry to bring back this topic now, but I would like to create an embedded variable which tracks the display order, so I am trying to do the solution you proposed, but I am new to Qualtrics and I am struggling. Could you detail your solution ?
In particular, what do you mean by "create a loop and merge field" ?
I hope you will see this..
Thanks a lot !

Leave a Reply