Flow designer - send email action with a request link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 07:42 AM - edited 10-06-2023 07:44 AM
Hi all, In flow designer I am trying to send an email via "send email" action, and I would like to know how I can include the request link within the email body for users to open it when they receive the email. I have checked the various existing posts but couldn't find/understand what to do.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 11:15 AM
Hi @Snowman15 ,
I have created a ServiceNow utilty for this on ServiceNow Share, you can download and import to your instance , it comes as action and you can use before your notification cation and have a link in the Send email action.
let me know if additional details required.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 02:50 AM
Hi @Hemanth M1,
I have done as you suggested, but didn't work, below the steps I took, please check if I missed something:
Action input: requested item table
Script with input and output
Output
Then I incorporated the action within the subflow and called it within email body
results: empty

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 02:34 AM
Hi @Snowman15 ,
Did you pass the sys_id of the RITM or Number as explained, Please check flow context
As input select sc_req_item table and pass sys_id/RITM number from the datapill or as an input from the flow
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2024 09:48 AM
@Snowman15 Use the below script and it should work
(function execute(inputs, outputs) {
var table = inputs.table;
var number = inputs.number;
var id = inputs.id;
var display = inputs.linkdisplay;
var record;
if (!display) {
display = "RecordLink";
}
// If sys_id is given
if (id) {
// Verify valid sys_id
var validID = new GlideRecord(table);
if (validID.get(id)) {
record = '<a href="' + gs.getProperty('glide.servlet.uri') + table + '.do?sys_id=' + id + '">' + display + '</a>';
} else {
record = "Please provide a valid sys_id to get the URL";
}
}
// If number is given
else if (number) {
// Get sys_id from the number
var out = "";
var findID = new GlideRecord(table);
findID.addQuery("number", number);
findID.setLimit(1);
findID.query();
if (findID.next()) {
out = findID.getValue("sys_id");
record = '<a href="' + gs.getProperty('glide.servlet.uri') + table + '.do?sys_id=' + out + '">' + display + '</a>';
} else {
record = "Not a valid Number, Please verify";
}
} else {
record = "No sys_id and Number provided to get the record URL";
}
outputs.url = record;
})(inputs, outputs);
/*
(function execute(inputs, outputs) {
// ... code ..
var table =inputs.table;
var number =inputs.number;
var id =inputs.id;
var display =inputs.linkdisplay;
var record;
if(!display){
display ="RecordLink"
}
//if sys_id is given.
if(id){
//verify valid sys_id
var validID = new GlideRecord(table);
if(validID.get(id)){
record = '<a href="https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri='+table+'.do?sys_id=' +id+ '">' +display + '</a>';
}
else{
record = "Please provide valid sys_id to get the URL";
}
}
//if numner is given
else if(number){
//get sys_id from the number
var out ="";
var findID = new GlideRecord(table);
findID.addQuery("number", number);
findID.setLimit(1);
findID.query();
if(findID.next()){
out =findID.getValue("sys_id");
record = '<a href="https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri='+table+'.do?sys_id=' +out+ '">' + display + '</a>';
}
else{
record = "Not a valid Number, Please verify";
}
}
else{
record ="No sysid and Number provided to get the record URL";
}
outputs.url =record;
})(inputs, outputs);
*/