Hello together,
In my theme in the Header I added this code. It creates an embedded data field “TIME”.
Removing setInterval also didn’t help.
<script>
Qualtrics.SurveyEngine.addOnReady(function() {
const current_time = function showCurrentTime() {
const now = new Date();
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const currentTime = `${hours}:${minutes}`;
console.log("Current Time:", currentTime); // Log only the current time in HH:MM format
return currentTime;
}
setInterval(showCurrentTime, 60000);
Qualtrics.SurveyEngine.setEmbeddedData( 'TIME', current_time );
});
</script>
When I add the field in the Survey Flow and Question it doesn’t show up
I would be glad to get some help. As I am quite new to the topic and didn’t find a workung solution in the Community
Thanks!
Cenk