Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

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