Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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