Survey link to Service Portal on notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2020 03:15 AM
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!
- Labels:
-
Notifications

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2020 04:53 AM
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2023 11:58 PM
Hi @Community Alums
How we can add incident link and short description like you on take survey form: