make URL hyperlink show INC number.

nick135
Tera Expert

So, I've added a field to the incident table called URL, which is of the URL type. We would like this field to be a hyperlink to the incident itself when it is exported to an excel document. I have the hyperlink portion of this working fine, but it would like to show the Incident number in this field, instead of the long URL. how would I go about accomplishing this?

find_real_file.png

4 REPLIES 4

ShubhamGarg
Kilo Sage

Hi Nick,

Have you tried using 'Document ID' type field to fulfill your requirement?

Ref. articles - 

What is document ID field Type ? How to set a value to a document ID field using script - Developer ...

Document ID field (servicenow.com)

Let me know if issue persists.

Mark this as Correct/Helpful if applicable.

Regards,

Shubham

 

this is not quite what we are looking for. The idea here is to include this field in a scheduled report. one of the columns in the report would be the hyperlinked field which would take the end user directly to the incident.

Aman Kumar S
Kilo Patron

Hi @nick

I had tried several way in PDI, but it doesn't seem to work in excel export to mask the URL with any text such as number.

You can have field as URL or HTML and in advanced view of dictionary set calculated as true and set script as:

return '<a href="https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=incident.do?sys_id=' +current.getUniqueValue() + '">'+ current.getValue("number") + '</a>';

It will generate mask the url in the form but not in excel.

Best Regards
Aman Kumar

Hi @nick

Is your issue resolved?


Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.

Will be helpful for others looking for the similar query.

Best Regards
Aman Kumar