Flow Design action: Generate Link to Table Record

Winnie P
Mega Sage

Hello there.  Short story - I have a request to insert a record link into generated Tasks if the RITM has attachment/s. I am trying to use Flow with this action 'Generate Link to Table Record' and add a work note update to the Task - Is this possible? I have used the above action in my Flow, however it does not create the record number / link, it spits out the code instead ie:

Results:

find_real_file.png

Expected results - I was hoping for something like this:find_real_file.png

This is my Flow:

find_real_file.png

tableName = 2-Look up Record > Requested Item Table
recordSysID = 2-Look up Record > Requested Item record > SysID
linkDisplayName = 2-Look up Record > Requested Item record > Number

find_real_file.png

3-Generate Link to Table record > link

Thank you.

 

1 ACCEPTED SOLUTION

Hi @Winnie Poelima

use this script and place inside f(x) inline script for work notes field

var sysId = fd_data.trigger.current.sys_id;

var rec = new GlideRecord('sc_task');
rec.get(sysId);

var text = "Note 1: There is an attachment/s in the RITM. Scroll down to RITM Attachments related tab to view the attachment.<br/>";

var url = "Note 2: Click the following to view the RITM record and it's attachments " + '<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + 'sc_req_item' + '.do?sys_id=' + rec.request_item + '">' + rec.request_item.getDisplayValue() + '</a>';

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

find_real_file.png

Regards
Ankur

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

View solution in original post

16 REPLIES 16

Thanks for the update Winnie.

Please try closing code tag as [/code]. 

[code] 3- Generate Link to Tab.... [/code]

Regards,
Muhammad

Ankur Bawiskar
Tera Patron
Tera Patron

Hi @Winnie Poelima

Is Step 3 a custom action or OOB one?

you can use inline script for setting work notes like this

return '[code]' + Output From Step3 + ['/code'];

Regards
Ankur

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

Heya Ankur, thank you for your reply.  Step 3 is an OOTB action. Do you have the full steps for your recommendation, will be happy to give that a go as well. Regards Winnie.

Hi @Winnie Poelima

use this script and place inside f(x) inline script for work notes field

var sysId = fd_data.trigger.current.sys_id;

var rec = new GlideRecord('sc_task');
rec.get(sysId);

var text = "Note 1: There is an attachment/s in the RITM. Scroll down to RITM Attachments related tab to view the attachment.<br/>";

var url = "Note 2: Click the following to view the RITM record and it's attachments " + '<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + 'sc_req_item' + '.do?sys_id=' + rec.request_item + '">' + rec.request_item.getDisplayValue() + '</a>';

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

find_real_file.png

Regards
Ankur

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

Hi @Winnie Poelima

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

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