Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Add hyper links to worknotes

pardhiv
Tera Contributor

I need to add hyper links in work notes from flow designer . Tried below code . It prints the following message, but not as hyperlink.

 

URL works fine when I test this by pasting it in browser

 

 

 

 

var URL1 = "https://"+gs.getProperty('instance_name')+".service-now.com/$flow-designer.do?sysparm_nostack=true&sysparm_use_polaris=false#/operations/context/"+inputs.executionflowcontext; 

  var finalURL = '<a href='+URL1 +'</a>';

  var finalURL2 = '[code]' + finalURL + '[/code]';
 
  outputs.finalurl3 = finalURL;

  outputs.finalurl4 = finalURL2;

//Tried setting both finalurl3  and finalurl4  to worknotes in seperate tests. They added the followign message.

//Output on worknotes
finalurl3  :

<a href=https://XXXXXXX.service-now.com/$flow-designer.do?sysparm_nostack=true&sysparm_use_polaris=false#/operations/context/21900ef25fe82990fe67a6dfefeef4ae</a>

finalurl4  :
<a href=https://XXXXXXX.service-now.com/$flow-designer.do?sysparm_nostack=true&sysparm_use_polaris=false#/operations/context/21900ef25fe82990fe67a6dfefeef4ae</a>

 

 

 

 

 

10 REPLIES 10

Mathesh SK1
Tera Contributor
var gr = new GlideRecord('incident');
gr.get('incident_sys_id');
var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/'+gr.getTableName() + '.do?sys_id=' + gr.sys_id + '" target="_blank">' + 'My Record' + '</a>[/code]';

gr.work_notes= url;
gr.update();