Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Unable to retrieve property value using gs.getProperty('') in scheduled report (sysauto_report)

pavan_yadav
Tera Contributor

I'm trying to use var prop = gs.getProperty('some.property.name'); inside a scheduled report (sysauto_report), but the value of prop keeps returning undefined. Can anyone confirm if gs.getProperty() works in scheduled reports, or if there's a limitation in that context?

 

Thanks,
Pavan.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@pavan_yadav 

I believe it has something to do with the sandboxing.

Check this link which talks the same which all classes are not allowed

Script sandbox property

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

31 REPLIES 31

in the condition field we can write script

pavan_yadav_0-1752662506217.png

 

Shraddha Kadam
Mega Sage

Hello @pavan_yadav ,

 

Follow the steps which is provided by @GlideFather , and if your system property is in the scope application, then make sure you are calling from the "name" field instead of the suffix. 

If my response was helpful, please mark it as correct and helpful.
Thank you.

Hi @Shraddha Kadam ,
my issue is in the table : sysauto_report has condition field, it is script field there im not able to retrieve the property value. I created a property in sys_properties table, name: schedule, application : global, type: string, and value: sysid of record cmn_schedule table

Chaitanya ILCR
Mega Patron

Hi @pavan_yadav ,

 

make sure there is no Typo

gs.getProperty()

 

ChaitanyaILCR_0-1752658983111.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

Hi @Chaitanya ILCR ,
my line is 

var sc = gs.getProperty('Schedule');
gs.log(sc); --> it is resulting undefined in sysauto_report tables condition field.
but when I try in background script, I'm able to see the sysid as result.