Hi there,
I know next to nothing about JS. I added two embedded variables to a survey (timeStampPRE and timeStampPOST). Now I am trying to get these variables to populate with the time when a participant starts and ends a key block within the survey.
I tried adding javascipt to the question before the key block...
Qualtrics.SurveyEngine.addOnUnload(function()
{
var timeStampPRE = new Date();
});
and the next question after the key block....
Qualtrics.SurveyEngine.addOnload(function()
{
var timeStampPOST = new Date();
});
But the fields show up as blank. How can I get these timestamps to show up in the embedded data fields?
Thank you!
Liz
JS code to add time stamps for question unload/onload
Best answer by TomG
First, you have to define the embedded data fields in the survey flow (e.g. timeStampPost). Then in your JS:
var timeStampPOST = Date();
Qualtrics.SurveyEngine.setEmbeddedData("timeStampPost",timeStampPost);
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.
