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

time picker to embedded data

  • January 27, 2022
  • 2 replies
  • 340 views

Forum|alt.badge.img

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.

Best answer by Wilco

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.

2 replies

Forum|alt.badge.img
  • Author
  • Answer
  • February 1, 2022

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.


Heith
Level 2 ●●
Forum|alt.badge.img+6
  • Level 2 ●●
  • July 9, 2022

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?