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

Hi @pardhiv ,

I am not sure what is the error here. The update of the Incident record should be after the output you received from the action.

 

for testing purpose I have created a action with the code and output type as string and it worked for me. Please find the below screenshots.

Screenshot 2023-01-27 at 4.05.02 PM.pngScreenshot 2023-01-27 at 4.05.12 PM.pngScreenshot 2023-01-27 at 4.05.42 PM.png

Screenshot 2023-01-27 at 4.05.50 PM.png

 

Check and see if you have changed the output string in both scripts output as well as flow output.

 

Regards,

Johns

Sonu Parab
Mega Sage
Mega Sage

@pardhiv ,Have a look at this post.

How do I display a clickable URL in my work notes? Please do not use the example that uses [code]. 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
Thank you

Hi @pardhiv ,

Try below URL 

var url = '<a href="' + gs.getProperty('instance_name') + '.service-now.com/$flow-designer.do?sysparm_nostack=true&sysparm_use_polaris=false#/operations/context/' + inputs.executionflowcontext + '">' + 'Click here' + '</a>';


OR go through the below thread, It is similar to your requirement.
How to add a hyperlink to flow designer? 


Tried your code and assigned it to work notes. This is still not working.

//This is the output notes on worknote

<a href="XXXXXX.service-now.com/$flow-designer.do?sysparm_nostack=true&sysparm_use_polaris=false#/operations/context/00ab4b0fbd286910df2c53aeed801db3">Click here</a>

Mayu
Tera Guru
Tera Guru

We can write a business rule .write below code .

var worknote = current.work_notes;

var link = '<a href="https://www.example.com" target="_blank">Example website</a>';  //here we can add your link;

current.work_notes = worknote + ' ' + link;

Please mark correct.