gliderecord-patterns

Solid

This skill should be used when the user asks to "query records", "GlideRecord", "database query", "get records", "update records", "insert record", "delete record", or any ServiceNow database operations.

Code & Development 68 stars 23 forks Updated today NOASSERTION

Install

View on GitHub

Quality Score: 77/100

Stars 20%
61
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# GlideRecord Best Practices for ServiceNow GlideRecord is the primary API for database operations in ServiceNow. Following these patterns ensures efficient and secure queries. ## Basic Query Patterns ### Get Single Record by sys_id ```javascript var gr = new GlideRecord("incident") if (gr.get("sys_id_here")) { gs.info("Found: " + gr.getValue("number")) } ``` ### Get Single Record by Field ```javascript var gr = new GlideRecord("sys_user") if (gr.get("user_name", "admin")) { gs.info("Found user: " + gr.getValue("name")) } ``` ### Query Multiple Records ```javascript var gr = new GlideRecord("incident") gr.addQuery("active", true) gr.addQuery("priority", "1") gr.orderByDesc("sys_created_on") gr.setLimit(100) gr.query() while (gr.next()) { gs.info(gr.getValue("number")) } ``` ## Encoded Queries (Faster) Use encoded queries for complex conditions - they're more efficient than multiple addQuery calls: ```javascript var gr = new GlideRecord("incident") // Encoded query from list view URL or Query Builder gr.addEncodedQuery("active=true^priority=1^assigned_toISEMPTY") gr.query() while (gr.next()) { // Process records } ``` ## Performance Tips ### 1. Always Use setLimit() ```javascript // When you only need X records var gr = new GlideRecord("incident") gr.addQuery("active", true) gr.setLimit(10) // Don't fetch more than needed gr.query() ``` ### 2. Use getValue() for Strings ```javascript // CORRECT - Returns string value var number = gr.getValue("number")...

Details

Author
groeimetai
Repository
groeimetai/snow-flow
Created
10 months ago
Last Updated
today
Language
TypeScript
License
NOASSERTION

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

API & Backend Solid

sql-optimization-patterns

Transform slow database queries into lightning-fast operations through systematic optimization, proper indexing, and query plan analysis.

52 Updated today
hainamchung
API & Backend Solid

database-patterns

Use when designing database schemas, implementing repository patterns, writing optimized queries, managing migrations, or working with indexes and transactions for SQL/NoSQL databases.

280 Updated 2 months ago
MadAppGang
Data & Documents Solid

gleam-erlang-interop

Use when gleam-Erlang interoperability including calling Erlang code from Gleam, using Erlang libraries, external functions, working with Erlang types, NIFs, and leveraging the BEAM ecosystem from Gleam applications.

158 Updated 3 weeks ago
TheBushidoCollective
Web & Frontend Solid

feishu-bitable

飞书多维表格(Bitable)的创建、查询、编辑和管理工具。包含 27 种字段类型支持、高级筛选、批量操作和视图管理。 **当以下情况时使用此 Skill**: (1) 需要创建或管理飞书多维表格 App (2) 需要在多维表格中新增、查询、修改、删除记录(行数据) (3) 需要管理字段(列)、视图、数据表 (4) 用户提到"多维表格"、"bitable"、"数据表"、"记录"、"字段" (5) 需要批量导入数据或批量更新多维表格

5,166 Updated 1 months ago
op7418
Data & Documents Featured

google-search-console

When the user wants to analyze Google Search Console data, use the GSC API, or interpret search performance. Also use when the user mentions "GSC," "Search Console," "indexing report," "Core Web Vitals," "Enhancements," "Insights report," "search performance," "search queries," "search performance report," "URL inspection," "impressions," "CTR," "average position," "index coverage," "GSC data analysis," "Search Console API," or "searchanalytics.query." When the user wants to rewrite title tags (not only report on them), use title-tag. For meta description rewrites, use meta-description.

318 Updated 1 months ago
kostja94