What This Table Is

The kb_category table stores knowledge base categories that create the hierarchical taxonomy for organizing knowledge articles. Each record represents a category node that can have parent and child relationships, enabling the tree structure that users navigate when browsing knowledge articles by topic.

This table is owned by the Knowledge Management module and supports the end-to-end content organization process from knowledge base creation through article publication and user consumption. Categories serve as both organizational containers and navigation aids, allowing knowledge authors to classify content and end users to discover relevant articles through browsing rather than search.

The table does not extend any parent table and is not commonly extended by child tables. Instead, it forms relationships through the self-referencing parent field and connects to knowledge articles through the kb_knowledge table's kb_category reference field.

Record volumes in this table are typically moderate, even in large enterprises. Most organizations maintain 50-500 categories across all knowledge bases, though complex implementations may reach 1,000+ categories. The hierarchical nature means query performance depends heavily on tree depth and the efficiency of parent-child traversal operations.

When You'll Script Against This Table

Developers typically interact with kb_category in Business Rules for category validation, Script Includes for building navigation trees, UI Actions for bulk category operations, and Client Scripts for dynamic category filtering. Background scripts are common for category maintenance and data migration tasks.

Access to this table requires the knowledge_admin role for full CRUD operations, while knowledge_manager provides limited access within specific knowledge bases. The table respects knowledge base scoping rules, so users only see categories for knowledge bases they have access to.

  • Building hierarchical navigation menus for knowledge portals
  • Validating category assignments to prevent orphaned articles
  • Calculating article counts per category for display purposes
  • Migrating category structures between knowledge bases
  • Enforcing category depth limits to prevent overly complex hierarchies
  • Generating category-based reporting for content analytics
  • Creating category templates for consistent knowledge base setup

Table Gotchas

⚠️

The `parent` field creates self-referencing relationships that can form infinite loops. Always validate parent assignments to prevent circular references that break navigation trees.

  • The kb_knowledge_base reference field enforces scoping but can be null for global categories, leading to unexpected query results
⚠️

Deleting categories with child categories or associated articles requires cascade handling. The platform doesn't automatically prevent deletion of categories that would orphan content.

  • The order field only controls sibling ordering within the same parent level, not global category ordering
  • Category names are not unique across knowledge bases, so queries must include knowledge base filtering to avoid duplicates
⚠️

Tree traversal queries can be expensive with deep hierarchies. Consider caching category trees or using path-based approaches for frequently accessed navigation structures.

  • The active field affects visibility but inactive parent categories can still have active children, creating broken navigation paths
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

The kb_knowledge table is the primary related table, as each knowledge article references a category through its kb_category field. The kb_knowledge_base table defines the knowledge base scope that contains categories and determines access permissions.

The sys_user_group and sys_user tables connect through knowledge base permissions and category management rights. Developers commonly query these together when building category-filtered article lists, validating user access to specific category trees, or generating navigation menus that respect user permissions.

The self-referencing relationship through the parent field means developers frequently perform recursive queries within the same table to build complete category hierarchies or validate tree structures.