Display logic based on date using javascript | XM Community
Solved

Display logic based on date using javascript

  • 11 March 2018
  • 1 reply
  • 25 views

From what I've read it seems Qualtrics does not provide display logic options for dates. Can anyone advise re: javascript code that would check the date a survey was being taken against a user-provided date(s). I want to allow survey completion if the date on which the survey is being taken corresponds to +/-7 days of a user-provided date.
icon

Best answer by TomG 11 March 2018, 14:21

View original

1 reply

Userlevel 7
Badge +27
If it were me, I would probably use a web service script instead of JavaScript for this.

Anyway, in JavaScript use Date.parse to convert the date strings to dates, then compare. Set an embedded data field based on the comparison that you can then use in the survey flow or display logic.

Leave a Reply