Clickable link not working in email script

anirban300
Kilo Guru

I have an email script where I am using a script include "Assessment" to fetch an URL.When checked in log link2 contains the URL.But when used in template.print then the variable link2 is fetched when clicked on the image "Anirban4.jpg" instead of the URL.Can some one suggest how to store the URL in a variable and then used in template.print?

******************************EMAIL SCRIPT********************************

var link2 = new Assessment().getITAssessmentInstance(current.sys_id);

gs.log("URL="+'link2");

template.print('<a href="link2"><img src="Anirban4.jpg"/></a>');

********************************************************************************

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

Correct your script to

 

var link2 = new Assessment().getITAssessmentInstance(current.sys_id);

gs.log("URL="+link2);

template.print('<a href="'+link2+'"><img src="Anirban4.jpg"/></a>');


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

5 REPLIES 5

Yes. I think you should send some additional parameter and then parse it using a client script in the survey.

I have never tried it on survey, but it works on catalog items. I am not sure if you can use a client script on Survey form. Below link might give you some direction

 

https://community.servicenow.com/community?id=community_question&sys_id=61f00ba5db98dbc01dcaf3231f96...


Please mark this response as correct or helpful if it assisted you with your question.