- 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 03:38 AM - edited 07-16-2025 03:40 AM
That is fine, but you got "undefined" because your scripted condition was:
var prop = gs.getProperty('com.glide.cs.branding.support_email_label');
gs.info(prop);
please add there some values to return and let me know how did it go.
Try something like this:
var prop = gs.getProperty('some.property.name');
//perhaps it must be prop = sys_id of the property
if(prop = 'Source') {
gs.info('Out if Prop true');
return true;
} else {
gs.info('Out if Prop false');
return false;
}
/* 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:52 AM
Yes I checked
If you have time just write your script or my script in that condition field and click on execute now button and check logs you will also get undefined.
- 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 05:10 AM
Hello, @Ankur Bawiskar ,
how to override this, I just want to write condition script only for one record, and to avoid hardcoding I chosen this.
For one record, I can not create script include.
i seen your reply in one of post:
Solved: Get property value in Report filter condition - ServiceNow Community
in that he is calling script include for multiple records, but in my case, for just one record only.
could you please confirm that why condition field is not behaving normally, is there any reason if yes how to override that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 05:32 AM
Please try with script include and then use gs.getProperty() schedule that report every 15mins to see if log came
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