Due to the fact that forms and lists are an integral part of the a back-end fulfiller’s experience within ServiceNow, we find we want to tailor the list experience more and more.

Some members of my team (Matt Metten and Mahathi Nalluri) recently made a wonderful little storyboard app where people could write out potential flows of experience based on a persona (or potential user) of a ServiceNow application. People would enter in stories and individual scenes. When they were done they could generate a graphical storyboard.

As people used the application, they realized that they wanted to have a clickable link within the list view of the storyboards that they use to open up a new window with the corresponding story board page.

ServiceNow

Implementing this is not too tough, but there is a specific “gotcha” you have to worry about. I thought I would outline the process here:

1. Create a field that will contain your link
I started out with a URL field. These are clickable in a list view, but found that URL’s could get pretty long which can mess up your list formatting mojo.

The other option is to create a String field. Make sure to give it a large enough Max Length. I gave mine 1000 characters. The other trick…the one that caused me the most consternation, is that you have to give that field an attribute of “No Truncate”. This is VERY important. I found if I didn’t use this, then longer URL’s would be truncated in the list view for some reason.

My dictionary entry for the URL field I created to contain my URL.  Click to view in detail.

My dictionary entry for the URL field I created to contain my URL. Click to view in detail.

2. Create a business rule to auto generate the link
In our scenario, we are opening a UI page and passing a URL parameter for the storyboard “sys_id”.

I created a business rule that, when the record is saved, and the URL field is empty, I generate the URL.

For this to work, you have to wrap your link HTML code within the [code] [/code] tags.

1
[code]<a href='/mylink_to_the_resource'>Click Me</a>[/code]

My onBefore business rule generates the necessary text following this format. Here is the business rule code:

1
2
3
4
5
6
function onBefore(current, previous) {
   //This function will be automatically called when this rule is processed.
   current.url = "[code]<a href='";
  current.url += "/x_snc_story_board_storyboard.do?sysparm_recid="+current.sys_id;
  current.url += "' target='_blank'>View Story</a>[/code]";
}

3. Configure your form and your list
Last step is to configure your form and your list views.

Hide the field from your form as it shows as a text edit field and does you little good.

Expose the field on the List View Configuration so that it shows up in one of the columns of your list.

The Result
ezgif-19878262