Survey link to Service Portal on notification

steveturley2
Giga Expert

I'm trying to get our link to the survey to point to our Service Portal

Our surveys are visible via the My Survey's widget but the URL obtained from 'View Survey URL' on the Survey Definition links back to the record inside SN rather than the Portal

Thanks for looking!

2 REPLIES 2

Community Alums
Not applicable

Hi,

 

If you have the survey instance sys_id, you can use that to route the surveys to the portal.

 

https://instancename.service-now.com/sp?id=take_survey&instance_id=sysIDOfSurveyInstance

 

Is your notification on 'asmt_assessment_instance' table? If yes, configure an email script 'click_survey' as below:

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
										   /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
										   /* Optional GlideRecord */ event) {

	// Add your code here
	var url= "https://instancename.service-now.com/sp?id=take_survey&instance_id="+current.sys_id;
	template.print('<a href=' + url + '>Click here to take survey!</a>' );
})(current, template, email, email_action, event);

 

And call this email script in your notification as below:

 

Please give us your feedback: ${mail_script:click_survey}

 

So whenever a user clicks on the link in the notification, the corresponding survey will be opened in portal view:

 

find_real_file.png

 

find_real_file.png

 

Hi @Community Alums 

 

How we can add incident link and short description like you on take survey form:

Chandra18_0-1680505094295.png