Call system property in client controller of a widget

Rohit Agarwal
Mega Expert

Hi,

How can we use/call system property in client controller of a widget??

Thanks,

Rohit

 

 

1 ACCEPTED SOLUTION

Sourav16
Kilo Guru

Hi,

You can store the system property in the data object in the server side section and reference the same thing in the client script of the widget .

eg:-

// Server side
(function() {
  
  data.propertyValue = gs.getProperty('your property name');

}();


//Client side
api.controller = function() {

 var c = this;
 console.log('Property value = ' + c.data.propertyValue);

}

 

 

Thanks

Sourav

 

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Possibly you will have to use GlideAjax to get that value

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Sourav16
Kilo Guru

Hi,

You can store the system property in the data object in the server side section and reference the same thing in the client script of the widget .

eg:-

// Server side
(function() {
  
  data.propertyValue = gs.getProperty('your property name');

}();


//Client side
api.controller = function() {

 var c = this;
 console.log('Property value = ' + c.data.propertyValue);

}

 

 

Thanks

Sourav