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

Glad to know that my script worked.

for role check I already mentioned this

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

 

}

Regards
Ankur

 

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

I have tried this out but it's not working 😞 . But if I remove this condition, it works.

But I need to check whether the user has an admin role or none before filtering the records

Hi,

!gs.hasRole('admin') will work

Did you check by adding logs if it went inside that if or not?

Regards
Ankur

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

Hello Ankur, unfortunately logs does not work when you use the script include on a dynamic filter.

Since the script include is client callable and called in a filter, gs.property and gs.log will not work. 

I think this is not working since if a user is not admin, it restricts the access to the sys_properties table that's why this does not work when the user does not have admin role.

Basically if admin, calling the property by gliderecord works, but if not admin, it does not.