The CreatorCon Call for Content is officially open! Get started here.

Making a link in an String field is not working properly.

Lavanya Nagendr
Giga Guru

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:

Screenshot 2023-09-15 at 6.30.57 PM.png

 

Kindly help me resolve this.

 

Thanks,

Lavanya

3 REPLIES 3

Marcos Kassak
Kilo Sage
Kilo Sage

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:

 

URL 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  🎯

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:

Screenshot 2023-09-19 at 5.57.34 PM.png

 

My Portal View:

 

Screenshot 2023-09-19 at 6.02.21 PM.png

 

Thanks!

 

Anurag Tripathi
Mega Patron
Mega Patron

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.

-Anurag