- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 08:12 AM
Hello, I am trying to embed a link to a message within Flow Designer. I was following this form but that wasn't working so I tried this below:
(function executeRule() {
// Get the sys_id from the Flow Designer's fd_data
var sysId = fd_data.trigger.request_item.sys_id;
// Make sure sysId is available
if (sysId) {
var tableName = 'sc_req_item'; // Table name for the RITM
var number = fd_data.trigger.request_item.number; // Assuming you have access to the RITM number
var baseUrl = gs.getProperty('glide.servlet.uri'); // Get the base URL of the instance
// Construct the URL
var url = '<a href="https://compass.sofi.com/esc?id=kb_article&table=kb_knowledge&sysparm_article=KB0010302">Windows 365 Cloud PC</a>';
// Create the comment with the embedded link
var comment = 'Your Windows 365 Cloud PC request has been approved. See ' + url + ' for instructions on accessing it. Please allow 60 minutes for it to complete deployment.';
// Update the comments field with the constructed comment
var gr = new GlideRecord(tableName);
if (gr.get(sysId)) {
gr.comments = comment;
gr.update();
}
} else {
gs.error('No sys_id found for the current record.');
}
})();
I am able to get the message posted but it doesn't embed the link into the comment. Can someone help enlighten me on what I am missing here?
Results:
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 08:17 AM - edited 06-25-2024 08:18 AM
I believe you need to add [CODE]<your html tag here>[/CODE] in order to get the comments field to recognize your HTML. Without that, it's representing your code as plain text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 08:17 AM - edited 06-25-2024 08:18 AM
I believe you need to add [CODE]<your html tag here>[/CODE] in order to get the comments field to recognize your HTML. Without that, it's representing your code as plain text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 10:05 AM
That worked when I try this:
(function executeRule() {
// Get the sys_id from the Flow Designer's fd_data
var sysId = fd_data.trigger.request_item.sys_id;
// Make sure sysId is available
if (sysId) {
var tableName = 'sc_req_item'; // Table name for the RITM
var number = fd_data.trigger.request_item.number; // Assuming you have access to the RITM number
var baseUrl = gs.getProperty('glide.servlet.uri'); // Get the base URL of the instance
// Construct the URL
var url = '<a href="https://compass.sofi.com/esc?id=kb_article&table=kb_knowledge&sysparm_article=KB0010302">Windows 365 Cloud PC</a>';
// Create the comment with the embedded link
var comment = 'Your Windows 365 Cloud PC request has been approved. See ' + '[code]' + url + '[/code]' + ' for instructions on accessing it. Please allow 60 minutes for it to complete deployment.';
// Update the comments field with the constructed comment
var gr = new GlideRecord(tableName);
if (gr.get(sysId)) {
gr.comments = comment;
gr.update();
}
} else {
gs.error('No sys_id found for the current record.');
}
})();
But when clicking the link from the comment posted, it will give a 'refused to connect' screen error.
But if I copy paste the link into a new window, it'll take me to the proper screen..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 10:17 AM
Turns out that the link only doesn't work from the admin portal but works perfectly fine in the SOW and the ESC. I will consider this resolved, thank you so much!