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.

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

Hi,

Possibly you will have to use GlideAjax to get that value

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  10x 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