โ† Back to list
groeimetai

catalog-items

by groeimetai

๐Ÿค– AI-powered ServiceNow development with 400+ MCP tools. Works with Claude, GPT, Gemini, Ollama & 75+ providers. Deploy widgets, manage incidents, automate workflows - all through natural language. Open-source Build Agent alternative.

โญ 42๐Ÿด 9๐Ÿ“… Jan 23, 2026

SKILL.md


name: catalog-items description: This skill should be used when the user asks to "create catalog item", "service catalog", "request item", "catalog variables", "variable set", "catalog client script", "order guide", "record producer", or any ServiceNow Service Catalog development. license: Apache-2.0 compatibility: Designed for Snow-Code and ServiceNow development metadata: author: groeimetai version: "1.0.0" category: servicenow tools:

  • snow_catalog_item_create
  • snow_catalog_variable_create
  • snow_query_table
  • snow_find_artifact

Service Catalog Development for ServiceNow

The Service Catalog allows users to request services and items through a self-service portal.

Catalog Components

ComponentPurposeExample
CatalogContainer for categoriesIT Service Catalog
CategoryGroup of itemsHardware, Software
ItemRequestable serviceNew Laptop Request
VariableForm field on itemLaptop Model dropdown
Variable SetReusable variable groupUser Details
ProducerCreates records directlyReport an Incident
Order GuideMulti-item wizardNew Employee Setup

Catalog Item Structure

Catalog Item: Request New Laptop
โ”œโ”€โ”€ Variables
โ”‚   โ”œโ”€โ”€ laptop_model (Reference: cmdb_model)
โ”‚   โ”œโ”€โ”€ reason (Multi-line text)
โ”‚   โ””โ”€โ”€ urgency (Choice: Low, Medium, High)
โ”œโ”€โ”€ Variable Sets
โ”‚   โ””โ”€โ”€ Delivery Information (Address, Contact)
โ”œโ”€โ”€ Catalog Client Scripts
โ”‚   โ”œโ”€โ”€ onLoad: Set defaults
โ”‚   โ””โ”€โ”€ onChange: Update price
โ”œโ”€โ”€ Workflows/Flows
โ”‚   โ””โ”€โ”€ Laptop Approval Flow
โ””โ”€โ”€ Fulfillment
    โ””โ”€โ”€ Creates Task for IT

Variable Types

TypeUse CaseExample
Single Line TextShort inputEmployee ID
Multi Line TextLong inputBusiness Justification
Select BoxSingle choicePriority
Check BoxYes/NoExpress Delivery
ReferenceLink to tableRequested For
DateDate pickerNeeded By Date
Lookup Select BoxFiltered referenceModel by Category
List CollectorMultiple selectionsCC Recipients
Container Start/EndVisual groupingHardware Options
MacroCustom widgetCost Calculator

Creating Catalog Variables

Basic Variable

// Via MCP
snow_create_catalog_variable({
  catalog_item: 'laptop_request',
  name: 'laptop_model',
  type: 'reference',
  reference: 'cmdb_model',
  reference_qual: 'category=computer',
  mandatory: true,
  order: 100
});

Variable with Dynamic Default

// Variable: requested_for
// Type: Reference (sys_user)
// Default value (script):
javascript:gs.getUserID()

Variable with Reference Qualifier

// Variable: assignment_group
// Type: Reference (sys_user_group)
// Reference Qualifier:

// Simple:
active=true^type=it

// Dynamic (Script):
javascript: 'active=true^manager=' + gs.getUserID()

// Advanced (using current variables):
javascript: 'u_department=' + current.variables.department

Catalog Client Scripts

Set Defaults onLoad

function onLoad() {
  // Set default values
  g_form.setValue('urgency', 'low');

  // Hide admin-only fields
  if (!g_user.hasRole('catalog_admin')) {
    g_form.setDisplay('cost_center', false);
  }

  // Set default date to tomorrow
  var tomorrow = new GlideDateTime();
  tomorrow.addDays(1);
  g_form.setValue('needed_by', tomorrow.getDate().getValue());
}

Dynamic Pricing onChange

function onChange(control, oldValue, newValue, isLoading) {
  if (isLoading) return;

  // Get price from selected model
  var ga = new GlideAjax('CatalogUtils');
  ga.addParam('sysparm_name', 'getModelPrice');
  ga.addParam('sysparm_model', newValue);
  ga.getXMLAnswer(function(price) {
    g_form.setValue('item_price', price);
    updateTotal();
  });
}

function updateTotal() {
  var price = parseFloat(g_form.getValue('item_price')) || 0;
  var quantity = parseInt(g_form.getValue('quantity')) || 1;
  g_form.setValue('total_cost', (price * quantity).toFixed(2));
}

Validation onSubmit

function onSubmit() {
  // Validate business justification for high-cost items
  var cost = parseFloat(g_form.getValue('total_cost'));
  var justification = g_form.getValue('business_justification');

  if (cost > 1000 && !justification) {
    g_form.showFieldMsg('business_justification',
      'Required for items over $1000', 'error');
    return false;
  }

  // Validate date is in future
  var neededBy = g_form.getValue('needed_by');
  var today = new GlideDateTime().getDate().getValue();
  if (neededBy < today) {
    g_form.showFieldMsg('needed_by',
      'Date must be in the future', 'error');
    return false;
  }

  return true;
}

Variable Sets

Creating Reusable Variable Sets

Variable Set: User Contact Information
โ”œโ”€โ”€ contact_name (Single Line Text)
โ”œโ”€โ”€ contact_email (Email)
โ”œโ”€โ”€ contact_phone (Single Line Text)
โ””โ”€โ”€ preferred_contact (Choice: Email, Phone, Either)

Use in multiple catalog items:
- New Laptop Request
- Software Installation
- Network Access Request

Accessing Variable Set Values

// In workflow or script
var ritm = current;  // sc_req_item

// Access variable from variable set
var contactEmail = ritm.variables.contact_email;
var preferredContact = ritm.variables.preferred_contact;

Catalog Workflows/Flows

Approval Pattern

Flow Trigger: sc_req_item created
โ”œโ”€โ”€ If: Total cost > $5000
โ”‚   โ””โ”€โ”€ Request Approval: Department Manager
โ”‚   โ””โ”€โ”€ If: Rejected
โ”‚       โ””โ”€โ”€ Update: RITM state = Closed Incomplete
โ”œโ”€โ”€ If: Total cost > $25000
โ”‚   โ””โ”€โ”€ Request Approval: VP
โ”œโ”€โ”€ Create: Catalog Task for Fulfillment
โ””โ”€โ”€ Wait: Task completion

Fulfillment Script

// In catalog item's "Execution Plan" or workflow

var ritm = current;  // sc_req_item

// Create an incident from catalog request
var inc = new GlideRecord('incident');
inc.initialize();
inc.setValue('short_description', ritm.short_description);
inc.setValue('description', ritm.description);
inc.setValue('caller_id', ritm.request.requested_for);
inc.setValue('category', ritm.variables.category);
inc.setValue('priority', ritm.variables.urgency);
inc.insert();

// Link incident to request
ritm.setValue('u_fulfillment_record', inc.getUniqueValue());
ritm.update();

Record Producers

Creating Incidents via Catalog

// Record Producer: Report an Issue
// Table: incident
// Script:

// Map variables to incident fields
current.short_description = producer.short_description;
current.description = producer.description;
current.caller_id = gs.getUserID();
current.category = producer.category;
current.subcategory = producer.subcategory;
current.priority = producer.urgency == 'urgent' ? '2' : '3';

// Set assignment based on category
if (producer.category == 'network') {
  current.assignment_group.setDisplayValue('Network Support');
} else {
  current.assignment_group.setDisplayValue('Service Desk');
}

Order Guides

Multi-Step Request Wizard

Order Guide: New Employee Onboarding
โ”œโ”€โ”€ Step 1: Employee Information
โ”‚   โ””โ”€โ”€ Variable Set: Employee Details
โ”œโ”€โ”€ Step 2: Hardware Selection
โ”‚   โ”œโ”€โ”€ Catalog Item: Laptop
โ”‚   โ”œโ”€โ”€ Catalog Item: Monitor
โ”‚   โ””โ”€โ”€ Catalog Item: Peripherals
โ”œโ”€โ”€ Step 3: Software Requests
โ”‚   โ””โ”€โ”€ Rule: Show software based on department
โ”œโ”€โ”€ Step 4: Access Requests
โ”‚   โ””โ”€โ”€ Cascade Variable: Copy employee info
โ””โ”€โ”€ Submit: Creates multiple RITMs

Order Guide Rule

// Rule: Show software items based on department
function rule(item, guide_variables) {
  var dept = guide_variables.department;

  // Show engineering software only for Engineering
  if (item.name == 'Engineering Software Suite') {
    return dept == 'engineering';
  }

  // Show finance software only for Finance
  if (item.name == 'Financial Tools') {
    return dept == 'finance';
  }

  return true;  // Show all other items
}

Pricing & Approvals

Dynamic Pricing

// Catalog Item Script (Pricing)
// Runs when item is added to cart

var basePrice = parseFloat(current.price) || 0;
var quantity = parseInt(current.variables.quantity) || 1;
var expedited = current.variables.expedited == 'true';

var total = basePrice * quantity;
if (expedited) {
  total *= 1.5;  // 50% rush fee
}

current.recurring_price = 0;
current.price = total;

Approval Rules

Approval Definition: High-Value Purchases
Condition: total_cost > 5000
Approver: requested_for.manager
Wait for: Approval
Rejection action: Cancel request

Best Practices

  1. Variable Naming - Use descriptive, lowercase names (no spaces)
  2. Variable Sets - Reuse common variable groups
  3. Reference Qualifiers - Filter to relevant records only
  4. Client Scripts - Minimize server calls (use GlideAjax sparingly)
  5. Fulfillment - Create tasks, don't complete directly
  6. Testing - Test as different user roles
  7. Mobile - Test catalog items on mobile/tablet
  8. Documentation - Add help text to variables

Score

Total Score

75/100

Based on repository quality metrics

โœ“SKILL.md

SKILL.mdใƒ•ใ‚กใ‚คใƒซใŒๅซใพใ‚Œใฆใ„ใ‚‹

+20
โœ“LICENSE

ใƒฉใ‚คใ‚ปใƒณใ‚นใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+10
โœ“่ชฌๆ˜Žๆ–‡

100ๆ–‡ๅญ—ไปฅไธŠใฎ่ชฌๆ˜ŽใŒใ‚ใ‚‹

+10
โ—‹ไบบๆฐ—

GitHub Stars 100ไปฅไธŠ

0/15
โœ“ๆœ€่ฟ‘ใฎๆดปๅ‹•

1ใƒถๆœˆไปฅๅ†…ใซๆ›ดๆ–ฐ

+10
โ—‹ใƒ•ใ‚ฉใƒผใ‚ฏ

10ๅ›žไปฅไธŠใƒ•ใ‚ฉใƒผใ‚ฏใ•ใ‚Œใฆใ„ใ‚‹

0/5
โœ“Issue็ฎก็†

ใ‚ชใƒผใƒ—ใƒณIssueใŒ50ๆœชๆบ€

+5
โœ“่จ€่ชž

ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐ่จ€่ชžใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+5
โœ“ใ‚ฟใ‚ฐ

1ใคไปฅไธŠใฎใ‚ฟใ‚ฐใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+5

Reviews

๐Ÿ’ฌ

Reviews coming soon