- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2022 09:53 PM
Hello ,
We have this comments field which is of Journal input type on form, with this field we communicate with end users, Currently this field is not useful to send clickable links, just the text could be sent but sometimes we would need to send the end users Links/URLs which are clickable.
How to achieve this with out the need to create a new field for URLs as we are not supposed to create any new fields due to license issues?
Thanks,
Spandana.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2022 09:55 PM
Hi,
you need to wrap the html tag within [code][/code]
Example
current.comments = [code]<a href="https://google.com" target="_blank">Google</a>[/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
07-13-2022 10:41 PM
Yes, if you want clickable you will need to use [code][/code] and enclose with html tags with link
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2022 07:47 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 05:06 AM
Hi
Were you able to achieve this? I have the same requirement. Could you pls let me know if it solved your query.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2022 11:38 PM
Hi
I was able to achieve it using another field. I was not allowed to create a new field so I used existing field "user input"- this is a string field. what we do now is that if we want to add clickable links to comments, we first add the link in the "user input" field and save the form. I wrote a script that adds https tags to links in user input and then add it to comments . with this we were able to add clickable urls in the comments. If we want to add more than one links, we just add the links in the user input field separated by comma.
-->Before Business rule (insert/update):
(function executeRule(current, previous /*null when async*/ ) {
var links = current.user_input;
var arr = links.split(',');
var finalArr = [];
for (var i = 0; i < arr.length; i++) {
if ((arr[i]).indexOf('http://') == -1 && (arr[i]).indexOf('https://') == -1) {
arr[i] = 'https://' + arr[i];
}
var notes = '[code]<a href="' + arr[i] + '" target="_blank">' + arr[i] + '</a>[/code]' + ' added';
finalArr.push(notes.toString());
//}
}
current.comments.setJournalEntry(finalArr.join('\n'));
current.user_input = ' ';
})(current, previous);
make sure that the field you use for this (ex: user_input) is not being used for any other purposes.