Get the system id of an instance?

abhinavjoshi
Mega Contributor

I am trying to fetch a system ID for a survey result ID, right now I am getting an static ID in the result and then look up the that ID in the service now survey results options, is there any way to get that link of the survey results directly, right now I am using this:

var html = '<a href="' + gs.getProperty('glide.servlet.uri') + 'nav_to.do?uri=' + current.getTableName() + '.do?sys_id=' + current.sys_id + '" target="blank">' + current.number + '</a>';  

but the current.sys_id is giving me the sys_id of the current instance not the instance in which the result is stored.

Any suggestions will be helpful.

2 REPLIES 2

Alex North
ServiceNow Employee
ServiceNow Employee

Hi Abhinav,



Where are you executing the code snippet above? What is the scope of "current"? Are you able to share a little more context around what you're trying to achieve?



Thanks,


Alex


Hi Alex,



I was able to resolve the issue, I was used the reference and got the system ID. Which I needed.



Thanks,


Abhinav