Display value for URL in List View / Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2014 01:36 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2015 11:08 AM
Gary, I am running into this requirement as well. Being able to display a URL/HTML(containing <a>) field in a list/report view is a challenge.
Were you able to get this to work? Any input would be great, thank you!
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2015 11:29 AM
Raghu, no, we were never able to get it to work. I think it is for security reasons though that the HTML elements aren't rendered as HTML.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2014 11:03 AM
Just got a request to implement something similar - provide a URL to the record on the list view.
Has anyone been able to look further / implement this?
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2014 07:23 AM
Can you please describe the requirement you are working on in a litlle bit more detail? Thanks.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2014 09:15 AM
The ask is to include a URL to the ticket so that when the list view is exported to a CSV or Excel file there's an easy way to go back to the task record.
I found a solution (not what is being asked for but good enough) to what I'm asking; I can add a calculated field with the following:
current.sys_id
the requester can then manipulate the sys_id field that has been exported to construct a URL like so:
https://<instance>.service-now.com/nav_to.do?uri=task.do?sys_id=<sys_id>
Cheers!