- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 02:08 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 03:42 AM
I believe it has something to do with the sandboxing.
Check this link which talks the same which all classes are not allowed
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 02:24 AM - edited 07-16-2025 02:26 AM
@pavan_yadav
check it in background script, what it returns when you call that property or you can log it..
I just tried to call a random property and that work, try it in you instance, similarly to:
And if it returns ok, then you know it is something with the scheduled report. Couldn't it be due to cross-scope?
EDIT:
in the script above I called this property:
And I noticed following:
- is the "read role", does your report have right to read the system property??
- isn't the property marked as Private?
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 02:39 AM
Hi @GlideFather ,
In background script or other places, I'm able to retrieve property value but in the sysauto_report table we have condition (script) field there if I try to retrieve property value it is giving me undefined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 02:40 AM
Can you provide screenshot of your script and system property
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 02:58 AM
@pavan_yadav can you please check the scope of your property?
And how did you add a script to sysauto_report? Is the report in the same scope as the property?
if you property is named "my_property" and scope is "x_snc_scope", then call it:
x_snc_scope.my_property
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 03:29 AM
@pavan_yadav I was asking here where did you manage to get a script for sysauto_report as there is no script field.
The only one is Condition, so you need to return the result for the Condition:
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */