The CreatorCon Call for Content is officially open! Get started here.

Request Number as the Hyperlink in Flow Designer through 'Send email'

Hari Krishna1
Tera Contributor

Hi All,

Hope everyone doing great,

    

         I'm planning to send RITM number as the hyper link through 'Send Email' in Flow designer, for this I written custom action , i called in flow and added in Send email body, for reference please see the attachement.

 

------

var  agentURL = '<a href=" ' + gs.getProperty('glide.servlet.url')  + inputs['recordTable'] + '/' + inputs['recordSysId'] + '">' + inputs['linkDisplayName'] + '</a>';
outputs['link'] = agentURL;
-----------
I written this script, but out put im getting number as the hyper link but its redirecting to that record its showing some error,  please correct my script and please any suggetions, Thanks in advance
 
 
ritm hyperlink.PNG
7 REPLIES 7

The URL doesn't look right if you're wanting to navigate to the native view (non workspace). There is also a typo in your system property (you can check this by using background script) as it results null result. It should be 

glide.servlet.uri

 

<a href=" ' + gs.getProperty('glide.servlet.url')  + inputs['recordTable'] + '/' + inputs['recordSysId'] + '">
//would result in
//instance_name.service-now.com/incident/sys_id_of_record

 

var instanceURI = gs.getProperty('glide.servlet.uri');
var tableName = inputs.recordTable;
var recordId = inputs.recordSysId;

var resultURL = instanceURI + tableName + '.do?sys_id=' + recordId;
var resultHTMLElement = '<a href="' + resultURL + '">' + inputs.linkDisplayName + '</a>';

 

Hari Krishna1
Tera Contributor

Hi Kieran,

Thanks for the response, its resolved my issue.

Great to hear. Please mark my answer as the solution to close off the question