How to add a hyperlink to flow designer?

Radhika11
Tera Contributor

Hello,

Can someone please provide suggestion on how we can use Flow Designer to add a hyperlink in RITM Work Notes to a change recorder?

 

Thank you

find_real_file.png

1 ACCEPTED SOLUTION

Hi,

just try this

var sysId = fd_data._7__for_each.item.sys_id;

var tableName = 'change_request';

var number = fd_data._7__for_each.item.number;

var url = '<a href="' + '/' + tableName + '.do?sys_id=' + sysId + '">' + number + '</a>';

return '[code]' + url + '[/code]';

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

23 REPLIES 23

Hello Ankur,

Here is the code I entered in f(x) script:

var sysId = fd_data.trigger.current.sys_id;
var tableName = fd_data.trigger.current.sys_class_name;
var number = fd_data.trigger.current.number;
var url = '<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + change_request + '.do?sys_id=' + c83c5e5347c12200e0ef563dbb9a7190 + '">' + CHG0030016 + '</a>';

return '[code]' + url + '[/code]';
 
When I save the Flow, it displays this error:

find_real_file.png

Hi,

I assume your flow trigger is RITM table

please update as this and test once

var sysId = fd_data.trigger.request_item.sys_id;

var tableName = 'sc_req_item';

var number = fd_data.trigger.request_item.number;

var url = '<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + tableName + '.do?sys_id=' + sysId + '">' + number + '</a>';

return '[code]' + url + '[/code]';

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur,

You’ve always been very helpful and responsive. We are very much appreciating your help.

Here is our use case so that you could understand and provide us with better assistance.

In Short Description field, it currently captured the Chang Request Number.  

We want this to be clickable hyperlink that would open the Change Request Number.

The hyperlink can be either in Short Description or Work Notes.  

 

find_real_file.png

 

Hi,

link can be shown only in work notes which is journal field and not short description

in the f(x) you can add script

example for hard-coding

var url = '<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + change_request + '.do?sys_id=' + 'c83c5e5347c12200e0ef563dbb9a7190' + '">' + 'CHG0030016' + '</a>';
 
return '[code]' + url + '[/code]';

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur,

I copied your entire code and pasted in the Work Notes.  It did not do anything.

 

find_real_file.png