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

Hi Chuck,

 

We have got a similar requirement to retrieve a sys_property is UI page client script but the asynchronous GlideAjax returns the value after the page is being rendered which is not expected.Tried calling g_scratchpad but haven't had any luck though.

Any suggestions are truly appreciated.

 

 

 

Regards,

Zabeeulla.

For standard form behaviors, this, or setting a session variable is how I'd normally accomplish it.  However, if I want to use this behavior in the catalog for a specific catalog item, how would I do this?

Thanks,

-Stephen

Thanks Chuck, I was in need of creating a system property to be available client side and this solution worked perfectly!  

Happy to help. Good to know my old posts are still working. 🙂

What if my clint script isa Catalog Client Script? I think I can not use Business rules for that.

P.D. I'm a big fan of your work and the best practices that you show us