Can I update loop and merge fields dynamically? | XM Community
Skip to main content
I have two arrays X and Y each of 80 elements, I want to shuffle the elements of the arrays....

I have to ask a question " What percentage of (word from array 😵 do you think are (word from array Y)? " 80 times and

for the first question I want first word from shuffled array X and first word from shuffled array Y

for the second question I want second word from shuffled array X and second word from shuffled array Y

and so on....

For example X= ["a","b","c","d","e"]

shuffled X = ["b","_c_","d","e","a"];

Y= ["p","q","r","s","t"]

shuffled Y = ["q","_r_","t","p","s"];

I want to present my 5 questions as

What percentage of b do you think are q?

What percentage of_ c_ do you think are_ r_?

Is there any possible way to do that?

What I though is to shuffle the arrays and place it in loop and merge so It loops according to the order.But I am not sure whether it is possible.
If you want to have one shuffled pairing of Xs and Ys that is shown to every participant (i.e., each person would see b with q and c with r), then you can shuffle the sets and place them in two columns in a loop and merge. Then for the questions you would just pipe in those fields. For example, you would have: "What percentage of ${lm://Field/1} do you think are ${lm://Field/2}?".



If you want each person to see different pairings of Xs and Ys (and if each question is being presented individually) then you could create 80 questions, 1 for each of version of X, and pipe in a random Y from the loop and merge field. You can randomize the presentation of the questions so that each participant would see the Xs in a random order (paired with Ys in a random order). For example, you would have: "What percentage of a do you think are ${lm://Field/1}?"
Thanks!! @mcoverdale

If I used 80 different questions and pipe the second using loop and merge I end up getting 6400 columns in the data stored... Is there any other way possible??
Hi @keharmo,

To be honest, I can't think of another way that would allow for any combination between the Xs and the Ys and have fewer columns... I'll keep thinking about it though.

Leave a Reply