System properties are ServiceNow's configuration mechanism, but they're cached in memory for performance. This creates a critical gap: when you update a sys_properties record, gs.getProperty() may still return the old value until the cache refreshes. Always provide a sensible default value — properties can be missing, empty, or misconfigured in production. The second parameter isn't optional in real applications.

When to use this

  • When you need configuration values that administrators can change without code deployment
  • For environment-specific settings like API endpoints, timeouts, or feature toggles
  • In Business Rules, Script Includes, or Scheduled Jobs where server-side configuration is needed
  • When you need values that change infrequently but must be configurable by non-developers

When NOT to use this

  • Don't use in client-side scripts — system properties aren't accessible from the browser
  • Don't store sensitive data like passwords — use encrypted fields in custom tables instead
  • Don't use for values that change frequently — database queries are more appropriate
  • Don't call repeatedly in loops — cache the value in a local variable if you need it multiple times

Key behaviors and gotchas

  • Properties are cached in memory — changes to sys_properties records may take several minutes to appear via gs.getProperty()
  • All values are returned as strings — use parseInt() or explicit string comparisons for non-string data
  • Missing properties return the default value — never null or undefined if you provide a default
  • Empty string properties return empty string, not the default — check for !value if empty strings should use defaults
  • Property names are case-sensitive and scope-aware — global properties are readable from scoped apps
  • Boolean properties must be explicitly compared to string 'true' — any non-empty string is truthy in JavaScript
⚠️

Property cache refresh is not instant. In development, you may update a property and wonder why your code still uses the old value. The cache can take 5-10 minutes to refresh, or requires a server restart. Plan your testing accordingly.

Free Newsletter

Enjoying this? Get one deep-dive per week.

Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.

No spam · Unsubscribe anytime