Logo: Generic Crud Operations

Generic Crud Operations

Organisatioun
Happy-Technologies-LLC
generic-crud-operations

Master generic table operations for querying, creating, updating, and reading records in any ServiceNow table

Iwwersiicht

EditeurHappy-Technologies-LLC
Repositoryhappy-platform-skills
Skill-Nummgeneric-crud-operations
Stären
41
Forks
14
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Happy-Technologies-LLC huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Generic Crud Operations an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/admin/generic-crud-operations
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Happy-Technologies-LLC/happy-platform-skills.git /tmp/happy-platform-skills
mkdir -p .claude/skills
cp -r /tmp/happy-platform-skills/skills/admin/generic-crud-operations .claude/skills/generic-crud-operations
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Generic Crud Operations an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Generic Crud Operations automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Generic Crud Operations net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Generic CRUD Operations

Overview

ServiceNow MCP provides generic tools that work on ANY table in the platform. This skill teaches you how to perform Create, Read, Update, and Delete (CRUD) operations across 160+ ServiceNow tables without needing specialized tools for each.

  • What problem does it solve? Provides a single, consistent approach to table operations
  • Who should use this skill? Developers, administrators, and integrators working with ServiceNow data
  • What are the expected outcomes? Ability to query, create, update, and retrieve records from any table

Prerequisites

  • MCP ServiceNow server configured and running
  • Appropriate ServiceNow roles for target tables (varies by table)
  • Basic understanding of ServiceNow table structure (sys_id, display values)

Procedure

Step 1: Discover Table Schema

Before working with any table, understand its structure using schema discovery.

Get Basic Schema:

Tool: SN-Get-Table-Schema
Parameters:
  table_name: incident

Response includes:

  • Field names and types
  • Field lengths and mandatory flags
  • Reference table relationships
  • Choice values for choice fields

Get Extended Schema:

Tool: SN-Discover-Table-Schema
Parameters:
  table_name: incident
  include_relationships: true

Response includes:

  • All base schema information
  • Parent/child table relationships
  • Referenced tables and foreign keys

Step 2: Query Records (Read)

Query any table using filters, field selection, and pagination.

Basic Query:

Tool: SN-Query-Table
Parameters:
  table_name: incident
  query: active=true
  limit: 10

Query with Field Selection:

Tool: SN-Query-Table
Parameters:
  table_name: incident
  query: active=true^priority=1
  fields: sys_id,number,short_description,state,assigned_to
  limit: 20

Query with Pagination:

Tool: SN-Query-Table
Parameters:
  table_name: incident
  query: active=true
  fields: number,short_description
  limit: 50
  offset: 100

Query with Ordering:

Tool: SN-Query-Table
Parameters:
  table_name: incident
  query: active=true^ORDERBYDESCpriority
  fields: number,short_description,priority
  limit: 25

Step 3: Get Single Record (Read)

Retrieve a specific record by sys_id.

Get Record:

Tool: SN-Get-Record
Parameters:
  table_name: incident
  sys_id: abc123def456...

Get Record with Field Selection:

Tool: SN-Get-Record
Parameters:
  table_name: incident
  sys_id: abc123def456...
  fields: number,short_description,state,priority,assigned_to

Step 4: Create Records (Create)

Create new records in any table with proper field values.

Create Record:

Tool: SN-Create-Record
Parameters:
  table_name: incident
  data:
    short_description: Network connectivity issue in Building A
    description: Users in Building A floor 3 unable to access network resources
    category: network
    subcategory: connectivity
    impact: 2
    urgency: 2
    caller_id: <user_sys_id>
    assignment_group: <group_sys_id>

Response Returns:

  • sys_id of the created record
  • number (if auto-generated)
  • All created field values

Create Record with Reference Fields:

Tool: SN-Create-Record
Parameters:
  table_name: task
  data:
    short_description: Follow up with customer
    parent: <parent_task_sys_id>
    assigned_to: <user_sys_id>
    assignment_group: <group_sys_id>
    due_date: 2024-12-31

Step 5: Update Records (Update)

Update existing records by sys_id.

Update Single Field:

Tool: SN-Update-Record
Parameters:
  table_name: incident
  sys_id: abc123def456...
  data:
    state: 2

Update Multiple Fields:

Tool: SN-Update-Record
Parameters:
  table_name: incident
  sys_id: abc123def456...
  data:
    state: 2
    assigned_to: <user_sys_id>
    work_notes: Investigation in progress
    priority: 2

Update Reference Fields:

Tool: SN-Update-Record
Parameters:
  table_name: incident
  sys_id: abc123def456...
  data:
    assignment_group: <new_group_sys_id>
    assigned_to: <new_user_sys_id>

Step 6: Batch Operations

Perform multiple operations efficiently.

Batch Create:

Tool: SN-Batch-Create
Parameters:
  records:
    - table: sys_user_group
      data:
        name: Network Support L1
        description: Level 1 network support
    - table: sys_user_group
      data:
        name: Network Support L2
        description: Level 2 network support
    - table: sys_user_group
      data:
        name: Network Support L3
        description: Level 3 network support

Batch Update:

Tool: SN-Batch-Update
Parameters:
  updates:
    - table: incident
      sys_id: abc123...
      data:
        state: 6
        resolution_code: Solved
    - table: incident
      sys_id: def456...
      data:
        state: 6
        resolution_code: Solved
    - table: incident
      sys_id: ghi789...
      data:
        state: 6
        resolution_code: Solved

Common Field Patterns

System Fields (All Tables)

FieldDescriptionNotes
sys_idUnique identifier32-character GUID, read-only
sys_created_onCreation timestampRead-only
sys_created_byCreator usernameRead-only
sys_updated_onLast update timestampRead-only
sys_updated_byLast updater usernameRead-only
sys_mod_countModification countRead-only
sys_class_nameTable nameFor extended tables

Reference Fields

Reference fields link to records in other tables.

Setting a Reference:

json
{
  "assigned_to": "5137153cc611227c000bbd1bd8cd2007"
}

Getting Display Values:

Tool: SN-Query-Table
Parameters:
  table_name: incident
  query: active=true
  fields: number,assigned_to,assigned_to.name,assigned_to.email
  limit: 10

Response includes:

json
{
  "assigned_to": {
    "value": "5137153cc611227c000bbd1bd8cd2007",
    "display_value": "John Smith"
  },
  "assigned_to.name": "John Smith",
  "assigned_to.email": "john.smith@example.com"
}

Choice Fields

Choice fields have predefined values.

Get Available Choices:

Tool: SN-Query-Table
Parameters:
  table_name: sys_choice
  query: name=incident^element=state
  fields: value,label

Common Incident States:

ValueLabel
1New
2In Progress
3On Hold
6Resolved
7Closed

Date/Time Fields

Date Format: YYYY-MM-DD DateTime Format: YYYY-MM-DD HH:MM:SS

Example:

json
{
  "due_date": "2024-12-31",
  "work_start": "2024-12-01 09:00:00"
}

Tool Usage

MCP Tools (Claude Code/Desktop)

ToolPurpose
SN-Query-TableQuery records with filters
SN-Get-RecordGet single record by sys_id
SN-Create-RecordCreate new records
SN-Update-RecordUpdate existing records
SN-Get-Table-SchemaDiscover table structure
SN-Discover-Table-SchemaExtended schema with relationships
SN-Batch-CreateCreate multiple records
SN-Batch-UpdateUpdate multiple records

REST API (ChatGPT/Other)

EndpointMethodPurpose
/api/now/table/{table}GETQuery records
/api/now/table/{table}/{sys_id}GETGet single record
/api/now/table/{table}POSTCreate record
/api/now/table/{table}/{sys_id}PATCHUpdate record
/api/now/table/{table}/{sys_id}PUTReplace record
/api/now/table/{table}/{sys_id}DELETEDelete record

REST Query Parameters:

ParameterDescription
sysparm_queryEncoded query string
sysparm_fieldsComma-separated field list
sysparm_limitMaximum records to return
sysparm_offsetRecords to skip (pagination)
sysparm_display_valueReturn display values (all, true, false)

Native Tools (Claude Code)

Use the MCP tools above as the primary path. Raw REST is a last resort only when an operation is unavailable through MCP. In that case, rely on an organization-approved local credential helper that is already configured outside the conversation. Never ask the user to paste authentication material, embed it in a command, or generate a request containing authentication headers. Preserve the same schema checks, field selection, pagination, ACLs, and explicit instance targeting used by the MCP workflow.

Best Practices

  • Always Check Schema First: Use SN-Get-Table-Schema before working with unfamiliar tables
  • Specify Fields: Include only needed fields to reduce response payload and improve performance
  • Use Pagination: For large datasets, use limit and offset to page through results
  • Validate sys_ids: Reference fields require valid sys_ids from the referenced table
  • Handle Errors: Check response for error messages, especially on create/update operations
  • Batch Operations: Use batch tools for multiple records (5-10+ operations) for efficiency

Troubleshooting

Record Not Found

Symptom: Query returns empty results or get returns 404 Cause: Invalid sys_id, record deleted, or insufficient permissions Solution: Verify sys_id exists and user has read access to the table

Permission Denied (403)

Symptom: 403 Forbidden error on create/update Cause: User lacks write permissions to the table or specific fields Solution: Check ACLs and required roles for the table operation

Invalid Field Value

Symptom: Create/update fails with field validation error Cause: Value doesn't match field type or choice list Solution: Check field schema for valid values, especially for choice and reference fields

Reference Field Rejected

Symptom: Reference field value not saved Cause: Invalid sys_id or referenced record doesn't exist Solution: Query the reference table to get valid sys_ids

Mandatory Field Missing

Symptom: Create fails with mandatory field error Cause: Required field not provided in data Solution: Check schema for mandatory fields and include all required values

Examples

Example 1: Query Active Users

Tool: SN-Query-Table
Parameters:
  table_name: sys_user
  query: active=true
  fields: sys_id,user_name,name,email,department
  limit: 50

Example 2: Create Configuration Item

Tool: SN-Create-Record
Parameters:
  table_name: cmdb_ci_server
  data:
    name: web-server-01
    ip_address: 192.168.1.100
    os: Linux Red Hat
    cpu_count: 4
    ram: 16384
    classification: Production
    environment: Production

Example 3: Update Multiple Incidents

Tool: SN-Batch-Update
Parameters:
  updates:
    - table: incident
      sys_id: inc001...
      data:
        assignment_group: <network_team_id>
        work_notes: Routing to network team per triage
    - table: incident
      sys_id: inc002...
      data:
        assignment_group: <network_team_id>
        work_notes: Routing to network team per triage

Example 4: Get Record with Dot-Walking

Tool: SN-Query-Table
Parameters:
  table_name: incident
  query: number=INC0010001
  fields: number,short_description,caller_id.name,caller_id.email,caller_id.department.name

Example 5: Paginated Query

# Page 1
Tool: SN-Query-Table
Parameters:
  table_name: change_request
  query: state=-1
  fields: number,short_description,start_date,end_date
  limit: 100
  offset: 0

# Page 2
Tool: SN-Query-Table
Parameters:
  table_name: change_request
  query: state=-1
  fields: number,short_description,start_date,end_date
  limit: 100
  offset: 100

Related Skills

  • itsm/natural-language-queries - Natural language search mastery
  • itsm/quick-reference - ITSM quick reference card
  • admin/batch-operations - Advanced batch operations

References

Heefeg gestallte Froen

Wat mécht de KI-Skill Generic Crud Operations?

Master generic table operations for querying, creating, updating, and reading records in any ServiceNow table

Firwat Generic Crud Operations op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Generic Crud Operations besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Generic Crud Operations an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/admin/generic-crud-operations an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Generic Crud Operations benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Generic Crud Operations benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Generic Crud Operations domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Generic Crud Operations gratis?

Jo. Happy-Technologies-LLC huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇