- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2019 02:35 PM
I'm attempting to create and\ Incident report that will include a direct link URL to the INC in SN. My reports are formatted for Excel.
Thank you in advance for any help you can provide.
Steve
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2019 07:09 AM
Unfortunately we do not have the OOB feature to get a URL of record in Excel report.
To get the URL you need to create a new field on incident table. Type of the field will be url and it will be a calculated field.
You need to add below code set the URL of the current record.
(function calculatedFieldValue(current) {
var url1=gs.getProperty('glide.servlet.uri')+"incident.do?sys_id="+current.sys_id;
return url1; // return the calculated value
})(current);
Please find the sample below:
Kindly mark my answer as Correct and helpful based on the impact.
Regards,
Chaitanya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2019 06:09 AM
I think you need to create a calculated field on the incident table to be able to do this. First, getting sys_id in a report isn't that easy. If you had the sys_id, you would just prepend https://xxx.service-now.com/task.do?sys_id=<Sys id of Incident> and you would have what you want. But since getting sys_id in a report is hard, you could pre-calculate this into a field and then just add that field to your report.
Calculated field would be something like https://xxxxx.service-now.com/task.do?sys_id=" + current.sys_id

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2019 07:09 AM
Unfortunately we do not have the OOB feature to get a URL of record in Excel report.
To get the URL you need to create a new field on incident table. Type of the field will be url and it will be a calculated field.
You need to add below code set the URL of the current record.
(function calculatedFieldValue(current) {
var url1=gs.getProperty('glide.servlet.uri')+"incident.do?sys_id="+current.sys_id;
return url1; // return the calculated value
})(current);
Please find the sample below:
Kindly mark my answer as Correct and helpful based on the impact.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 06:29 AM
is there a way to make this a bit cleaner? instead of displaying the URL, say we display the incident number instead?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2019 01:15 PM
Thank you.