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

Johns Marokky
Tera Guru

Hi @pardhiv ,

Almost your code is correct. only few changes needs to be done on the finalURL Variable.

Change the finalURL variable to the below code.

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

 

and try to add the FinalURL2 to the worknotes. i think this would help in resolving the issue.

 

Mark helpful if it helps in solving your query.

Regards,

Johns

Modified the Code . But it still doesnt show as hyperlink . Fyi , The output in flow designer is a URL Variable. Does that have any Impact

 

 

(function execute(inputs, outputs) {

 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 +'>flow execution</a>';
 
   var finalURL2 = '[code]' + finalURL + '[/code]';
 
  outputs.finalurl3 = finalURL;
  outputs.finalurl4 = finalURL2;

//This is the how it looks in work Notes when I add finalurl4 , Does it have any impact if the update record step is before outputs step

<a href=https://XXXXX.service-now.com/$flow-designer.do?sysparm_nostack=true&sysparm_use_polaris=false#/operations/context/00ab4b0fbd286910df2c53aeed801db3>flow execution</a>


  
})(inputs, outputs);

 

Hi @pardhiv ,

Can you convert the output into string type and see if it fixes the issue?

 

Regards,

Johns

No luck