- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2022 08:06 PM
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:
Expected results - I was hoping for something like this:
This is my Flow:
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
3-Generate Link to Table record > link
Thank you.
Solved! Go to Solution.
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 01:57 AM
Hi
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'];
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2022 06:54 PM
Hi
I just saw your reply on this post
Links not coming as hypertext in comments or worknotes in workspaxe
Try this in background script and you will get an idea how this works. As per my knowledge it will work without setting glide.ui.journal.use_html as true.
var gr = new GlideRecord('incident');
gr.get('<sys_id_of_any_open_incident_record>');
//gr.work_notes = '[code]' + '<a href="https://<dev_instance_name>.service-now.com/incident.do?sys_id=-1" target="_blank">Create New Incident</a>' + '[/code]';
gr.work_notes = '[code]' + '<a href="https://www.google.com" target="_blank">Open Google</a>' + '[/code]';
gr.update();
You can also test it via inserting work_notes manually. See the below image for reference.
[code]<a href=https://www.google.com target=_blank>Open Google</a>[/code]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 01:28 PM
Thank you for your time Muhammad. I tried the background script and got this:
I also tested just manually added [code]<a href=https://www.google.com target=_blank>Open Google</a>[/code] to worknotes & got the same results as the above update.
I will investigate further into enabling the sys property that controls the code tags, otherwise have been thinking of another way to complete the initial request instead of using a script or the Flow action step: Generate Link to Table Record.
Regards Winnie.