Hi I was wondering how I can implement a Custom Code. | XM Community
Question

Hi I was wondering how I can implement a Custom Code.

  • 12 April 2021
  • 3 replies
  • 5 views

Badge

Hi I was wondering how I can implement a Custom Code. I have been trying to implement the following code into my Survey, but unfortunaley I haven't been able to do so.
I want my Survey to change the date automatically in a Weekly fashion. Meaning that It shows monday Next week and the following days.
In addition I wanted the Survey to show the Current and following Calender Week.
I found these codes:

  1.   

  2.   

  3.       </b>Calculate week number of current date<b>  

  4.   

  5.   

  6.        

  7.   

  8.  


I would highly apreciate any kind of help, as I don't really know how to do this.
Expecially how I can make the code display its' result in the Survey.


3 replies

Badge

https://www.qualtrics.com/community/discussion/comment/36500#Comment_36500Hi ahmedA,
I'm still not able to exceute this as an action that provides me with a piped text that i can insert into my survey that modifys my surveys date.
Do you know why?

Badge

Hi ahmedA,
I'm still not able to exceute this as an action that provides me with a piped text that i can insert into my survey that modifys my surveys date.
Do you know why?

Userlevel 7
Badge +21

Add this at the end of line 5:

Week Numbers of current date ( ) is:


Replace line 21 and 22 with:
document.querySelector("#today").innerText = todaydate;
document.querySelector("#res").innerText = result;

Leave a Reply