- 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:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 03:21 AM
Hi @Community Alums
the above is sysauto_report table condition field script and
below is sys_properties table record
when i check logs
im getting -->
in background script im able to see sys id of created property.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 03:28 AM
@pavan_yadav I got it!!!!
It is because you are entering the script to Condition field 😉
And it doesn't make sense for condition.
/* 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:31 AM - edited 07-16-2025 03:32 AM
Try anything similar to:
(just a draft, not tested)
var prop = gs.getProperty('some.property.name');
if(prop = 'Source') {
return true;
} else {
return false;
}
*prop return sys id so the if condition the script shall be per sys_id not name...
/* 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:35 AM
Hello @GlideFather ,
But in the condition we can write script some ootb script screen shot below,
condition is a script field, so for the below script it is working.
And also i have tried like below:
im getting result but to avoid hardcoding I want to use properties here.