Access GlideSystem from UI Script?

adevezin
Giga Contributor

Hello,

so while in a UI Script i am not able to use 'gs' to access the glidesystem. Is there another way to allow me to access? I specifically need to run gs.getProperty() from a UI Script.

7 REPLIES 7

b-rad might have a good solution for this.


Brad Tilton
ServiceNow Employee
ServiceNow Employee

You've got a number of different options. Since the UI Script runs client side, there's no method to access a system property. You could either use GlideAjax + Script Include or use Angular's http service + Scripted REST API. You would be getting the property value in the server side script and returning it to the client.



The other option would be to get it in the jelly during page load. You could add something like this to the ui page:



<script>


    var prop = '${gs.getProperty("property name")}';


</script>



Then you could use that prop variable in any subsequent client side script.


adevezin
Giga Contributor

bump?