Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 08:23 PM
so notification is triggering from workflow on CHG table.
2 ways
1) To show link to approval record you will have to use email script in workflow notification activity
<mail_script>
var gr = new GlideRecord("sysapproval_approver");
gr.addQuery("sysapproval", current.sys_id);
gr.query();
if (gr.next()) {
var sysId = gr.sys_id;
var tableName = 'sysapproval_approver'; // table name
var instance_name = gs.getProperty('glide.servlet.uri');
template.print('Click here <a href="' + instance_name + tableName +'.do?sys_id="' + sysId + '">' + 'Approval Record' + '</a>');
}
</mail_script>
See how you can add that below
OR Another Approach
2) you can use run script to store the link in workflow scratchpad and then use that workflow scratchpad in message of workflow notification activity
Run Script:
var gr = new GlideRecord("sysapproval_approver");
gr.addQuery("sysapproval", current.sys_id);
gr.query();
if (gr.next()) {
var instance_name = gs.getProperty('glide.servlet.uri');
workflow.scratchpad.approvalLink = 'Click <a href="' + instance_name + tableName + '.do?sys_id="' + taskID + '">' + taskNum + '</a> to view the Task.';
}
Then use this in workflow notification message part
${workflow.scratchpad.approvalLink}
Here in below image use ${workflow.scratchpad.approvalLink} to show that link
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader