We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to get the sysid from url and gets its display value via client script

surya123
Mega Guru

hi All

This is the url I have

https://www.myinstance.servicenow/u_tester.do?sysparm_document_key=b346c9c04f29d2006c29f5a18110c7ed

I want to write a on Load client script, which picks up this sysid's display value.

Can you please help me on how to achieve this?

Thanks

Surya

1 ACCEPTED SOLUTION
5 REPLIES 5

srinivasthelu
Tera Guru

Hi Surya,



Below is the code.



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<body onload="test()">


  <script>


  function test()


  {


  var m='${sysparm_document_key}';


  alert(m);


  }


  </script>


  </body>


</j:jelly>




Thanks


Srini


Hi Srini,


Can we write client scripts for capturing the display value of sysid of url?



Thanks


Surya


Hi Surya,



I would say pass additional Display value parameter as well along with sys_id. If not you can always write a GlideRecord again in our page to get the display value



Hope this helps


Srini



Mark this response as correct/helpful if it does so