how to pipe the text answers from a loop and merge to next question? | XM Community
Skip to main content

Hi all, does anyone know how to pipe looped form field answers to my next question in a different block? I tried using the carry forward statement, but the answer doesn't appear.
I need my participants to type in their thoughts for 10 mins (each time they type in their answer and press the blue forward button, they will get a new form field, because their previous answer needs to be hidden from then, that's why I am doing a loop and merge for the question) and then pipe in their thoughts to the next question, for them to rate the experience. Could someone help me out with this? thank you.
This is what I did:
Screenshot 2022-03-23 at 23.40.40.pngScreenshot 2022-03-23 at 23.41.07.png
p.s if you guys know how to build in a timer so that such questions will keep appearing (when they press forward) until the time run out, it will be much appreciated.

If the question where you are trying to pipe in the comment entered is in next page, then you can use insert piped text to view the thoughts entered by the end user:
image.png


https://community.qualtrics.com/XMcommunity/discussion/comment/44864#Comment_44864hi, because mine needs to come from the loop, your way sometime, will leave a lot of blank tho. Is it possible to do a loop and merge with your way?


Hi there,

What I would try is:

  1. create an embedded data field like time_up set it to 0

  2. add a display logic on all thought questions display if time_up = 0

  3. create as many text entry questions as respondents might be able to answer in 10 minutes.

  4. Capture the time when they start the first question in an embedded data field startTime

  5. calculate the time difference when they submit a question if the time difference = 10 minutes set the embedded data field time_up = 1, thus the following questions won't be shown

  6. In your case respondent can end the loop by answering no on the more thought question: for this i also would add an embedded data field no_more_thought and set it in the beginning of your survey and set it to 1 when a respondent selects no

  7. this means that display logic in the loop needs to be expanded to display if time_up = 0 AND no_more_thought = 0

then follow the steps proposed by Aanurag_QC above. However, add a display logic based on textTntryValue is not empty
Hope this helps
Best regards
Rudi




https://community.qualtrics.com/XMcommunity/discussion/comment/44871#Comment_44871Hi Rudi,
Thank you so much for the help, however, I am not sure if I did it correctly, could you have a look?
Screenshot 2022-03-24 at 10.17.08.pngfollow by
Screenshot 2022-03-24 at 10.16.02.pngFor step 3 when u said "creat as many text entry as possible" do you mean in the loop and merge field?
For step 4, I cannot find this option in the embedded data field tho.
and I am not sure what do you mean by step 5, and how to do steps 6 and 7, currently they still keep looping until the field (for test, I only set up 6) run out even I press no. Sorry for the trouble.

Also, if I want to set the time to 12 mins, what should I change?


Many thanks
Halleyson


hi Hallyson,

okay let's start with walk through 🙂
Survey Flow embedde data:
image.pngthe 600000 are 10 minutes in milliseconds for

before the loop:
have one question/text info before the loop

image.png
add the below javaScript to set the start time of the experiment. Make sure that this question is shown for every one as you need the start time.

Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
let startTime = new Date().getTime();
console.log(startTime)
Qualtrics.SurveyEngine.setEmbeddedData("start_time", startTime);

});


loop question set up
image.pngmind that you need to force response else you get empty text fields
in the first question of the loop add the below JS:
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
let timeLimit = "${e://Field/time_limit}"
let startTime ="${e://Field/start_time}"
let currentTime = new Date().getTime()
console.log(startTime)
console.log(currentTime - startTime)
if(currentTime - startTime >= timeLimit){
Qualtrics.SurveyEngine.setEmbeddedData("time_is_up", 1); //if time is up set the embedded data field to 1
}
});
in the second question add this javaScript
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
let selectedChoice = Number(this.getChoiceRecodeValue(this.getSelectedChoices()))

console.log(selectedChoice)

if(selectedChoice == 2){ //adjust the number 2 to your recode of the now option

Qualtrics.SurveyEngine.setEmbeddedData("no_more_thought", 1);
}

});
finally set up your slider question:

image.png
diplay logic would on eacht item would look somethink like:
image.png
Best regards

Rudi


Thank you so much for the help Rudi ! really appreciated it!
However, the slider question does not seem to work. it leaves a slider, but does not pipe down the name, do you know what is happening?
Screenshot 2022-03-24 at 11.02.06.pngThis is what I get (I type 2 thoughts in so the slider number is correct, only no piped names)
Screenshot 2022-03-24 at 11.02.34.png
Also, sorry to trouble you again, but is it possible, after time up, it auto-forwards to the next question?

Many thanks
Halleyson


Hi,

does it show the entered text when you remove the display logic?

Best regards
Rudi


Hi Rudi ,

No, it doesn't.

Screenshot 2022-03-24 at 11.17.53.png
Many thanks
Halleyson


Hey there,

that's a lot of questions 😀

you missed adding the fields start_time and time_limit in your survey flow.

for 10 minutes set the time_limit to 600 000. for 12 minutes to 720 000 the formula is minutes*60*1000 (time in JS is in milliseconds)
both the fields time_is_up and no_more_questions_should be set to 0 at the beginning.
actually the enter as many text entry fields ... is wrong. First I assumed a loop and merge setup wouldn't work so I thought you need to add text entry questions. What I really have meant is: add as many loop iterations as you think one person can answer in 10 or 12 Minutes

you need to add the javascript snippets I've sent you to your questions

you'll find this option here:

image.png
the display logic in the loop questions should be:

image.png
Please mind you really need to enter the JavaScript. Else the whole thing won't work

Best regards

Rudi



Hi Rudi,

Sorry, I forgot to update my last question, after your second post with the explanation + code, everything already worked! With the qsf file you send me, I figure out that the pipe text problem is due to I used the form field, but you use the text entry (which is even better! thank you).

Many thanks
Halleyson


https://community.qualtrics.com/XMcommunity/discussion/comment/44885#Comment_44885Please, check if you are piping the answers:-) and if the display logic refers to the according answers
Best regards

Rudi


Hi Rudi,

Sorry to trouble you again, is it possible to set it auto-advance after it reaches time limits? in this case, I could remove the yes and no options.
Really sorry for all the hassle I've created😢
Many thanks
Halleyson


Hi

@Halleyson
,
don't worry. Your setup is actually a bit out of the norm and challenging.
I am not quite sure what the requirement for auto-forwarding is.
I assume that the aim would be: if the respondent doesn't click on the next button for x seconds/minutes actively you want the respondent to be auto-forwarded without showing any other questions within the loop. Is this correct?
BTW, I just came up with another problem you should solve. Assume the respondent doesn't enter a thought, he will see an empty slider question. The solution would be to add a display logic on your slider question (not only on the items)
you would need formulate the display logic in a way similar to this:

image.png
Best regards

Rudi




Hi Rudi,
https://community.qualtrics.com/XMcommunity/discussion/comment/44894#Comment_44894Sorry, I did not make it clear, what I mean is, after 12 mins, this loop will auto stop and auto-forward to my next question (the slider). So it's like building in a timer.
also, I was wondering if the qualtrics will record the time frame (response time) that participants type in the response? like first thought was typed in 1 min 30 seconds, second thought was typed in 3 mins 22 seconds.

Many thanks
Halleyson Li



hi, you could do something like this:


Qualtrics.SurveyEngine.addOnload(function()
{
let loopNumber = Number("${lm://CurrentLoopNumber}")
if (loopNumber > 1){
let timeLimit = "${e://Field/time_limit}"
let startTime ="${e://Field/start_time}"
let currentTime = new Date().getTime()
console.log(startTime)
console.log(currentTime - startTime)
if(currentTime - startTime >= timeLimit){
Qualtrics.SurveyEngine.setEmbeddedData("time_is_up", 1);
this.clickNextButton()
}
  }
});

this go into the text entry question in the loop.

Regarding timing question : this comes with qualtrics:
Timing QuestionBest regards
Rudi


Hi Rudi,
https://community.qualtrics.com/XMcommunity/discussion/comment/44898#Comment_44898Thank you so much for the help, btw, just to let you know, in order for your code to work, it need to set a timer with auto-advance before the question's entry box, then your code does the tricks😆. Honestly, I could not thank you enough for the help you gave. Sorry for all the hassle I create
Many thanks
Halleyson


Leave a Reply