Add hyper links to worknotes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 09:56 PM - edited 01-27-2023 01:24 AM
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 02:39 AM
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.
Check and see if you have changed the output string in both scripts output as well as flow output.
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 10:31 PM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 02:05 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 02:15 AM
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 01:20 AM
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.