HELP! Adding Timestamp after questions in a Looped Block | XM Community
Skip to main content

Hi all,
It looks like there is 1 previous post (link) that discussed this but the code doesn't work for us.
We have a Loop & Merge block (to be looped for X times), and we want to add a timestamp to track the completion of EACH loop. (eg Time 1, Time 2, for each of the 2 Looped trials).
We tried and found:

  • Timestamp works in non-Looped blocks but doesn't work when included in the Looped block.

  • Timestamp (eg Piped Text current date) can be presented to User when included in Looped block, but the Timestamps do not show in the Exported Data File.

But we could not figure out how to add timestamps to Looped blocks.
Could anyone help? Is there something we need to add to the JavaScript and/or Survey Flow (for embedded data?).

That is the correct and working method, just add a text entry question at the end of loop and merge block, and add TomG code as below to that question:
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId).hide();
});
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
jQuery("#"+this.questionId+" input[type=text]").val(new Date());
});


Thanks for responding rondev! I tried the code but with no success.
In our data file (downloaded), the only relevant variable is: Recorded Date. But this is the one that records the final time/date of completion of the entire survey (ie X number of loops done and submitted).
Other variables which we created Embedded Data for exist (irrespective of the Javascript code) but only the Last embedded time/date shows up in the Datafile.

Let me know if this does/doesn't make sense.


Leave a Reply