Concatenate a URL and Sys ID into a usable link

Sam Brooks
Kilo Contributor

I am exporting data from ServiceNow from an export set to a tool which provides us with a dashboard based on the data we have. The data is surrounding User Information, however, I would like to include a URL so that anyone who is on the dashboard can click on a hyperlink related to a user and then this would take them to ServiceNow. 

 

I have seen something similar for incidents as below, however, how could I do this for the sys_user table, if possible?

 

Example

Calculation: 'https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=incident.do?sys_id=' +current.sys_id ;

1 ACCEPTED SOLUTION

Andrew Barnes -
ServiceNow Employee
ServiceNow Employee

Greetings Sam,

 All you need to change is the word incident in your URL example.

 'https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=tablenamegoeshere.do?sys_id=' +current.sys_id ;

'https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=sys_user.do?sys_id=' +current.sys_id ;

-Andrew Barnes
Join me at Developer Blog

View solution in original post

4 REPLIES 4

Harsh Vardhan
Giga Patron

gs.print(gs.getProperty('glide.servlet.uri'));

the above script will give you full instance url and then add the other line 

Harsh Vardhan
Giga Patron

gs.print(gs.getProperty('glide.servlet.uri')+'incident.do?sys_id='+'549b52eddbdcf740e4d95740cf961961');

 

 

Andrew Barnes -
ServiceNow Employee
ServiceNow Employee

Greetings Sam,

 All you need to change is the word incident in your URL example.

 'https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=tablenamegoeshere.do?sys_id=' +current.sys_id ;

'https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=sys_user.do?sys_id=' +current.sys_id ;

-Andrew Barnes
Join me at Developer Blog

How do you do this with the ServiceId  BSN000001  ? the sysid is inhumain  lol