The CreatorCon Call for Content is officially open! Get started here.

Call a property in script include

Evren Yamin
Tera Contributor

Hello,

Is there a way to call the value of a property in a script include? I tried using gliderecord on the sys_properties table ang getting the value but it's not working.

Here is the script that I have used 

find_real_file.png

17 REPLIES 17

I have tried that one first but it's not working properly when called in script include.

Then saw this in the community 

find_real_file.png

Hi,

okay that's correct then

if script include is client callable and used in reports filter condition then it won't work

update your script as this

1) declare the variable property_value outside

var property_value;
var property = new GlideRecord("sys_property");
property.addQuery("name", "hidden.group_type");
property.query();
if (property.next()) {
    property_value = property.value;
}

// your logic here

Regards
Ankur

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

Unfortunately, this is not working when I add the condition here

find_real_file.png

did my script work for getting property value?

to check role use this

if(!gs.hasRole('admin')){

 

}

Regards
Ankur

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

yes but it's not working when the condition to look for the role is added