Hello,
I have a block where I utilize Loop & Merge in order to choose one value from a set of values. As such, the loop only occurs once.
For example, Field 1: 10, 20, 30, 40, 50.
1 random loop may choose 20.
I want to input text in subsequent blocks that incorporates 20 or whatever was chosen in the loop.
-------------------------------------------------------------------------------------------------------------
Example:
Block 1: 20 is chosen from [10,20,30,40,50] by loop & merge function
Q1: "You are receiving $20 for this study"
Final Block:
Qi: "Thank you for participating in this study. You will receive $20."
-------------------------------------------------------------------------------------------------------------
I am hoping to do this because the random amount reappears in many blocks. With something like display logic or then if branches, I would have to create r x q iterations. Where r is the amount of possible random values and q is every question/text where that value appears. Right now, that is 8 x 20......
Solved
How do you carry a value from a loop & merge into a new block?

Best answer by TomG
A loop & merge probably wasn't the best choice for picking a random number. Anyway, now that you've done it that way, the easiest way to pipe the random value going forward is to add JS to your loop question to save it to an embedded data field.
Qualtrics.SurveyEngine.addOnload(function() {
Qualtrics.SurveyEngine.setEmbeddedData("randAmt","${lm://Field/1}");
});
Leave a Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.