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 system properties client side?

peterraeves
Mega Guru

What's the client side equivalent of 'gs.getProperty'?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

I prefer to use 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



I believe we covered this in episode 5 of TechNow.


TechNow Episode List


View solution in original post

14 REPLIES 14

Dubz
Mega Sage

I don't think there is one, i think you'll have to create the property in a script include and then call it from the client side using a GlideAjax.


Jaspal Singh
Mega Patron
Mega Patron

Hi Peter,



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


GlideAjax - ServiceNow Wiki


Kalaiarasan Pus
Giga Sage

Nothing in the client side that can do this as far as I know. But,



  • If it is a table, display business rule + g_scratchpad to store the system property to be used in client side scripts.
  • If it is a catalog, then a plain glideajax to read it.

Chuck Tomasi
Tera Patron

I prefer to use 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



I believe we covered this in episode 5 of TechNow.


TechNow Episode List