Making a link in an String field is not working properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 06:02 AM - edited 09-15-2023 06:04 AM
Hi All,
I have a requirement to make a string field as a link in the List view. The below is my script, its not working properly,
pol.u_link_to_full_document = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/grc?id=lineitem&table=' + pol.getTableName() + '&sys_id=' + pol.parent.sys_id + '">' + pol.getDisplayValue() + '</a>[/code]';
Output:
Kindly help me resolve this.
Thanks,
Lavanya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2023 08:38 AM
Hi @Lavanya Nagendr,
You can try to use a calculation type of field and add a dictionary no_truncate:
Display value for URL in List View / Report
Or simply use a URL type of field:
If you found my answer helpful or correct in any way, please don't forget to mark it to help future readers! 👍
--
Kind regards,
Marcos Kassak
Solution Consultant 🎯
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 12:07 AM
Hi @Marcos Kassak,
I was using the method you mentioned above its working fine in UI but its not a clickable link service portal. May i know how to make it clickable in portal as well?
My UI view:
My Portal View:
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2023 02:48 PM
Hi,
I have a requirement to make a string field as a link in the List view --> the only way this may work is if you use a URL field, you cant achieve this in any other field unless its a reference field to another record withing servicenow.