Show Link/URL in List with Display Value

MarcB1
Tera Guru

Hi

We like to insert a link to a Catalog Item in a "regular" list.

I know there is a field type "URL" and another type "HTML".

Unfortunately, the HTML field type only works fine on the form itself and the URL field type does not allow setting an display value.

How is it possible?

List.png

Form.png

btw: the values are calculated:

calc.png

1 ACCEPTED SOLUTION

None that I know of at this point for the list view.



I love the idea and invite you to open an enhancement request! Our product managers DO listen.


Enhancement requests: Tell us how you would improve the ServiceNow product


View solution in original post

39 REPLIES 39

@ralvarez 

I'm having the exact same issue, cannot get it to work in Workspace lists.

Tadz
Kilo Sage
Kilo Sage

Hi ralvarez, thank you for posting this. it helped me a lot 😄

Community Alums
Not applicable

{[Code]} is not working under related list, but it's working under LIST.

here is the screen shot and can you help me on that please.

 

 

find_real_file.png

calebc
Giga Contributor

I found that the suggested solution only worked for the list view. The field on the record's form view showed as follows. If anyone has a better workaround please post it. The workaround is effective but there should be something better.

find_real_file.png

Here's a workaround:

1. Create a url field with a calculated value that generates the url onView.

Calculated value:

(function calculatedFieldValue(current) {

	// Add your code here
	return 'report_home.do?sysparm_query=table=x_delr2_ecose_resource_capacity^titleLIKE' + current.resource + '^titleLIKE' + current.configuration_item.name;  // return the calculated value
})(current);

2. Hide the url field from the default list view, but include this on the form view.

Result:

find_real_file.png

4. Create a String field with the suggested solution that references the value from the url field.

(function calculatedFieldValue(current) {
	
	return "[code]<a href='"+current.graph+"' target='_blank' class='btn btn-default  icon-open-document-new-tab'>&nbsp;"+'graph'+"</a>[/code]"; 
})(current);

5. Hide the url field from the form view, but display it on the list view.

Result:

find_real_file.png

I am following your solution and it is working to a point.  Here is the code for my calculated value.

 

(function calculatedFieldValue(current) {

return "[code]<a href='"+current.u_wizard_link+"' target='_blank' class='btn btn-default  icon-open-document-new-tab'>;"+'Deer Form Link'+"</a>[/code]";

})(current);

 

Here are the results:

find_real_file.png

The Button works when I click Deer Form Link, so that is good.   Can you tell me why I see the CODE blocks in the field as well?