Hello, I am somewhat new to Qualtrics and JavaScript. I have been trying to create a "for loop" to iterate over the fields in Loop and Merge and form a string with them. I am using a "for loop" because in the questions I have use a different number of fields.
I can get the information in the loop and merge fields if I do it manually like below.
var sentence = "${lm://Field/1}" + " " + "${lm://Field/2}" + " " + .... + "${lm://Field/10}";
alert('Original sentence ---> ' + sentence);
However, I want to do it with a "for loop" to iterate over the value saved in each field by accessing it by their number. Is this possible? I have been trying different things but I can't figure out how to use variables within template strings in Qualtrics.
var sentence = "";
for(i=0; i<10; i++)
{
var words = "${lm://Field/" + (i+1).toString() +"}";
sentence = sentence + " " + words;
}
alert('Original sentence ---> ' + sentence);
Any ides?
Miguel Santin
Iterate over the fields of Loop and Merge
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

