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

Ankur,

I copied the link and pasted in the browser. It took me to the wrong change request number:

find_real_file.png

 

 

Here is the code:

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]';

Hi,

it means the link is working fine

but the record you are referring is incorrect

your URL will take as per record sys_id; so query the CHG table with that sys_id and get the CHG number and then include that

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

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

Hello Ankur,

I think you are very close to get this works for us.

This is the code:

find_real_file.png

 

It is still no sync with the change recorder. It is still taking me to this blank page:

 

find_real_file.png

 

It works if I right click on the change number and "Open link in new window"

find_real_file.png

 

did you check what URL is formed? by printing the url variable in the script section?

Regards
Ankur

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

I right clicked on the link and open link in new window and this works find:

https://xxxxx.service-now.com/nav_to.do?uri=%2Fchange_request.do%3Fsys_id%3D3019b2a02fb53010e31b51072799b609

However, when I single clicked on the link, it opened this URL to a blank page.

https://dev65048.service-now.com/nav_to.do?uri=%2Fhome.do%3F

 

Here is the current code:

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="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + tableName + '.do?sys_id=' + sysId + '">' + number + '</a>';

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

Please help...

Thank you so much!