Access scoped system property from global scope.

Drct1234
Mega Expert

Hello,
Is there a way to set a scoped system property from the Global scope (using gs.getProperty)?
I already tried setting it through a scoped API call.
Error: Not allowing update of property: x_scope_mine.my_property_123. 
Thanks!

1 ACCEPTED SOLUTION

Thanks for the update Drc1234. 

Let me know if that answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

View solution in original post

19 REPLIES 19

Yes, it works on the backgroundscript but not on the script include.
This is my script inlcude:
find_real_file.png

My method is something like this:

setProp: function() {
   var value = this.getParameter('sysparm_value_1');
   gs.setProperty('some_prop', value);
}

Thanks!

use below code

 

setProp: function() {
   var value = this.getParameter('sysparm_value_1');
   var str = value.toString();
   gs.setProperty('some_prop', str);
}

Thanks for the update. I have just tested and it works fine.

setProp: function() {
   
   gs.setProperty('some_prop', 'test');
}

toString() didn't solve it.

I keep getting
find_real_file.png

Thanks for your help.

For testing purposes can you replace with below code. Please make sure to update suffix name in the code before you save it.

setProp: function() {
   var value = this.getParameter('sysparm_value_1');
   var propGr = new GlideRecord('sys_properties');
propGr.addQuery('suffix', "PASS PROPERTY SUFFIX NAME HERE');
propGr.query();
if(propGr.next())
{

propGr.value = this.getParameter('sysparm_value_1');
propGr.setWorkflow(false);
 propGr.update(); 
}
}