What This Table Is

The sys_portal table stores the master configuration for each Service Portal instance. Each record represents a complete portal configuration including URL suffix, theme selection, homepage definition, CSS variable overrides, and knowledge base associations. This table is the entry point that determines how users access and experience your portal.

Owned by the Service Portal module, this table supports the entire portal framework from initial load to theme rendering. When users hit /sp or a custom portal URL, ServiceNow queries this table to determine which portal configuration to load, then cascades through the associated theme, pages, and widgets.

This is a standalone configuration table — it doesn't extend task or any other table, and no tables extend it. Portal records are referenced by sp_page and sp_theme records to build the complete portal experience.

Record volume stays extremely low — most enterprises have 2-10 portal records representing different portal experiences (employee portal, customer portal, vendor portal). Performance is rarely a concern due to aggressive caching, but portal changes require cache clearing to take effect.

When You'll Script Against This Table

You'll primarily script against sys_portal in Business Rules for portal lifecycle management, Script Includes for portal resolution logic, and Scheduled Jobs for bulk portal configuration updates. Widget Server Scripts occasionally query this table to determine portal-specific behavior or branding.

Portal records inherit standard ACL permissions — sp_admin and admin roles can modify portal configurations, while most scripts run in global scope and can read portal data freely.

Common scripting patterns:

  • Query by URL suffix to resolve which portal configuration to load
  • Bulk update CSS variables across multiple portals during rebranding
  • Clone portal configurations for new departments or subsidiaries
  • Dynamically switch themes based on user attributes or business rules
  • Generate portal URLs programmatically for email templates and notifications
  • Audit portal configuration changes and maintain configuration documentation
  • Enable or disable portals based on maintenance schedules or business conditions

Table Gotchas

⚠️

Portal changes require cache clearing to take effect. The url_suffix field change won't be visible to users until you clear the cache or restart the instance.

  • The css_variables field stores JSON but displays as a plain text area — invalid JSON breaks portal rendering silently
⚠️

Empty url_suffix creates the default portal accessed via /sp — only one portal can have an empty suffix per instance.

  • The quick_start_user reference field determines which user's perspective is used for portal previews in the designer
  • Portal records with active=false still respond to direct URL access — use Business Rules to redirect or block access
⚠️

The homepage reference can point to pages in different portals, creating confusing cross-portal navigation — always verify page-to-portal associations.

  • Theme changes cascade to all portal pages immediately but CSS variable changes require individual page cache clearing for complex pages with embedded widgets
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

Portal configuration directly references sp_theme (theme selection), sp_page (homepage definition), kb_knowledge_base (knowledge base association), and sys_user (quick start user). These relationships form the foundation of portal architecture.

You'll frequently query sp_page alongside portal records to understand complete portal structure, and sp_instance_menu to build navigation menus. Widget developers commonly join portal and theme data to access CSS variables and branding elements programmatically.

When troubleshooting portal issues, developers typically start with sys_portal, then follow references to sp_theme and sp_page to trace configuration problems through the complete portal rendering pipeline.