Display value for URL in List View / Report

garyopela
ServiceNow Employee
ServiceNow Employee

Hello, I have been asked by a process owner to add a field to Project, which, when clicked from a report, would open a window of all tasks under that project. I have it figured out, but it's not pretty.

 

What I did was add a calculated field with the following calculation:

 

<code>

var link = "https://instance.service-now.com/pm_project_task_list.do?sysparm_query=parent%3D" + current.sys_id + "%5E";

javascript:"<a href=" + link + "> Tasks </a>";

</code>

 

It works great when you look at the field on the form. It shows up as "Tasks" and if you click on it, it directs you to the URL. The problem is that the lists and the reports are stripping the HTML (I'm sure it is to prevent HTML injection).

 

I need a way around this. I want the link to display in list and report view as 'Tasks' and be clickable. Also because it is not executing the HTMl in the table, the links are incorrect because of the a hrefs. I can replace all that with just the link itself, but that is very ugly when looking at it in a list.

 

Anyways, bottom line is that I want to replicate the a href functionality in the lists and reports. Any suggestions are welcome.

11 REPLIES 11

I extended the calculated part to this:


        "https://<instance>.service-now.com/nav_to.do?uri=task.do?sys_id=" + current.sys_id



IvanBarsukov
Tera Expert

The no_truncate dictionary attribute will solve the issue
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0853971