🚀 Why gs.getProperty() Doesn’t Work in Reporting Filter Conditions — And How to Fix It! 🔧
New article articles in ServiceNow Community
·
Jan 08, 2026
·
article
Over the years, I’ve noticed many developers in the ServiceNow Community asking why gs.getProperty() doesn’t work when used inside a client‑callable Script Include, especially when that Script Include is triggered from a Report Filter Condition. 🤔
I faced the same issue a while back and was equally surprised by this limitation — so here’s a clear explanation and the workaround that saved the day! 💡
❗ The Challenge
When a Script Include is client‑callable and is invoked through a report filter condition, the script actually executes on the client side.
This means:
👉 gs.getProperty() ❌ does NOT work in this context
👉 Because gs = server-side GlideSystem
👉 And a client-callable Script Include runs partially on the client, causing gs methods to fail
✅ The Workaround That Works
Instead of using gs.getProperty(), you can:
🔍 Use GlideRecord to query the sys_properties table
Retrieve the property value like this:
var propValue = ""; var grProp = new GlideRecord("sys_properties"); grProp.addQuery("name", ""); grProp.query(); if (grProp.next()) { propValue = grProp.value.toString(); } // use this propValue now
This runs perfectly even when executed via a reporting filter condition. ✔️
📊 My Results
❌ Before
Using gs.getProperty() → No result returned
✅ After
Querying via GlideRecord → Property value returned successfully
🎉 Final Thoughts
This is a simple but important detail that can save you hours of debugging.
If you're working with reports + client-callable script includes, avoid gs.getProperty() and go with a GlideRecord lookup instead. 💪
https://www.servicenow.com/community/platform-analytics-articles/why-gs-getproperty-doesn-t-work-in-reporting-filter-conditions/ta-p/3462951