Custom ${URI_REF} link not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 04:19 AM
Within my workflow, I've specified an event that takes the user to a certain record in the 'sc_req_item' table if a request has been cancelled by specifying 'grEvent.uri' in the below code:
The below is my notification:
However, when the email notification is generated, the ${URI_REF} instead takes the user to the 'sysapproval_approver' record, which is not what I want.
What do I need to do in my notification or workflow so that it takes the user to the URL specified in 'grEvent.uri'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 02:01 AM
I hope you are aware on how to include email script in email body
${mail_script:mailScriptName}
Sample email script
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var taskID = current.sys_id;
var tableName = 'sc_req_item'; // table name
var instance_name = gs.getProperty('glide.servlet.uri');
template.print('Click here to view the request online <a href="' + instance_name + tableName +'&sys_id="' + taskID + '&view=sp' + '">' + taskNum + '</a>');
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:27 AM
@matthew_hughes Can you try using ${document_id.URI_REF}