time picker to embedded data | XM Community
Skip to main content

Hi,

I'm using a time picker to help respondents to a survey enter a time. The javascript I'm using for the time picker is this:

Qualtrics.SurveyEngine.addOnReady(function()
{

var Qbd = "input[id='QR~"+this.questionId+"']";

jQuery("#" + this.questionId + " .InputText").hide();

jQuery("#appt-time").on(" change", function() {

jQuery(Qbd).val(jQuery("#appt-time").val()) ;

});

});

With this HTML code in the Rich Content Editor:

Hoe laat is het gesprek begonnen? Reken de triage en het teruglezen daarvan niet mee.  


 


 


The time picker works fine, but when I try to save the input from the time picker in the embedded data and call it later on in the survey, it returns '0'. The Embedded data is set from the survey flow using piped text, like this:

${q://QID1/ChoiceTextEntryValue}

How could I store the time from the time picker in the embedded data as a string? Thanks in advance.

I figured this out myself, I'll post the solution in case anyone runs into a similar issue. The problem seems to be that the embedded data field could not handle the time-format in hh:mm. I solved it by converting the time into seconds and save the time in seconds to the embedded data.


https://community.qualtrics.com/XMcommunity/discussion/comment/43297#Comment_43297Hi there - I'm trying to use this (thank you for posting it!) could you let me know how you converted the time into second and saved it as second in the embedded data?


Leave a Reply