gs.getProperty equivalent for client scripts

Tadz
Tera Guru
Tera Guru

Hi, I wan't to avoid harcoding sys_id, and gs.getProperty does not work on client script.

Is there a equivalent for gs.getProperty in the client script(I am using onload client script)?

or is there any other workaround here?

Thanks,

Tadz

4 REPLIES 4

Mihir Mohanta
Kilo Sage

Hi Cris,



1.Create a script include.Use gs.getProperty in that script include.


2.Call the previously created script include from client script.



Thanks,


Mihir


amaradiswamy
Kilo Sage

Hi Cris Thadeo Cortes,



Please define a script include and call it by using glideajax in client script.


GlideAjax - ServiceNow Wiki



Thanks and regards,


Swamy


ghsrikanth
Tera Guru

May be you can create a display business rule which stores the gs.getProperty in g_scratchpad variable


and you can use this variable in   your client script


Community Alums
Not applicable

I am following Chuch's idea of using a Display Business Rule and put the property in to a g_scratchpad variable. You can then use it in an onLoad script.

BR: g_scratchpad.my_property = gs.getProperty('my.property');

CS: var myProperty = g_scratchpad.my_property

Chuck Tomasi covered this in episode 5 of TechNow: TechNow Episode List