Shorten the url in URL type field in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 01:52 AM
Hi team,
I need your help in shortening the url mentioned under URL type field.
I have a URL type field and under calculated section with calculation type as script, I have given the script something as below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 01:56 AM - edited 07-19-2024 01:58 AM
Hi @Shubham Deep You store a URL in a variable and can use it. Refer below script and modify accordingly
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0759336
var url = 'www.google.com';
var linkName = 'Link Name';
task.work_notes = '[code]<a href="' + url + '">' + linkName + '</a>[/code]';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 03:05 AM
@Sid_Takali : Thanks for your suggestion. The above is not working for "URL" type field. I think it works in the task notes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 02:09 AM