gliderecord-patterns

Provide GlideRecord best practices and code examples for ServiceNow database operations.

77|23|Updated Jul 16, 2025
One-click install
npx skills add https://github.com/groeimetai/snow-flow --skill gliderecord-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gliderecord-patterns
Source: https://github.com/groeimetai/snow-flow/tree/main/packages/opencode/src/bundled-skills/gliderecord-patterns
Command: npx skills add https://github.com/groeimetai/snow-flow --skill gliderecord-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides best practices and examples for efficiently and securely interacting with the ServiceNow database using GlideRecord, covering common query, insert, update, and delete operations.

Core Features & Use Cases

  • Efficient Querying: Learn to use addQuery, addEncodedQuery, and setLimit for optimal data retrieval.
  • CRUD Operations: Understand patterns for inserting, updating, and deleting records.
  • Performance & Security: Implement best practices to avoid common pitfalls and ensure secure database interactions.
  • Use Case: When you need to retrieve all active incidents assigned to a specific user that were created in the last 7 days, this skill provides the exact GlideRecord code to do it efficiently.

Quick Start

Use the gliderecord-patterns skill to get all active incidents with priority 1.

Frequently Asked Questions about gliderecord-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query ServiceNow records using GlideRecord efficiently?

GlideRecord supports standard CRUD operations in ServiceNow, allowing developers to insert, update, and delete records programmatically. You instantiate the GlideRecord class, specify the target table, and call the insert, update, or deleteRecord methods.

What is the best way to write an encoded query in ServiceNow?

An encoded query in ServiceNow is a URL-encoded string representing complex database filters. Using addEncodedQuery with GlideRecord applies multiple conditions efficiently, replicating list view filters directly within server-side scripting for precise data retrieval.

How do I perform bulk update operations with GlideRecord in ServiceNow?

GlideRecord bulk updates in ServiceNow involve querying a record set and iterating through the results to modify fields. You call update on each record within the loop, ensuring security constraints are checked while applying changes across multiple database entries.

What are the security considerations when using GlideRecord for database operations?

GlideRecord security in ServiceNow involves enforcing access controls and query business rules during database operations. Developers must ensure scripts respect ACLs and avoid bypassing security checks when inserting, updating, or deleting records to maintain data integrity.

Why is my GlideRecord query returning slow performance in ServiceNow?

Slow GlideRecord performance in ServiceNow often stems from missing setLimit usage, inefficient addQuery conditions, or retrieving unnecessary fields. Optimizing database operations requires limiting result sets and ensuring queries leverage database indexes properly.