Function: CatalogItem(config)
Creates a Service Catalog Item (sc_cat_item) — a requestable item in the ServiceNow Service Catalog.
Parameters
config
object
Catalog item configuration — name, description, variables, fulfillment process, and visibility settings.
Properties:
-
$id (required):
string | number | ExplicitKey<string> -
name (required):
stringName to appear in the catalog. Required. -
accessType (optional, default: 'restricted'):
'restricted' | 'delegated'Option to specify if a request can be submitted for a user who does not have access to the catalog item -
active (optional, default: true):
booleanCheck box to make the item active (available to be ordered) -
assignedTopics (optional):
(string | Record<'topic'>)[]The assigned topics for the catalog item -
availability (optional, default: 'desktopOnly'):
'both' | 'desktopOnly' | 'mobileOnly'The availability of the catalog item -
availableFor (optional):
(string | Record<'user_criteria'>)[]The users/groups this item is available for -
billable (optional, default: false):
booleanThe billable status of the catalog item -
catalogs (optional):
(string | Record<'sc_catalog'>)[]The catalogs the catalog item belongs to -
categories (optional):
(string | Record<'sc_category'>)[]Category for the item. Categories can only be selected after the Catalogs field is populated. -
checkedOut (optional):
booleanThe checked out for the catalog item -
cost (optional, default: 0):
numberThe cost of the catalog item -
customCart (optional):
string | Record<'sys_ui_macro'>The custom cart for the catalog item -
deliveryPlanScript (optional):
stringThe delivery plan script for the catalog item -
deliveryTime (optional):
DurationThe delivery time for the catalog item -
description (optional):
stringThe detailed description of the catalog item -
displayPriceProperty (optional):
stringThe display price property for the catalog item -
entitlementScript (optional):
stringThe entitlement script for the catalog item -
executionPlan (optional):
string | Record<'sc_cat_item_delivery_plan'>The execution plan for the catalog item. Mutually exclusive with flow and workflow. -
flow (optional):
string | FlowDefinition<Record<string, FlowValueType>> | Record<'sys_hub_flow'>Flow that defines how the item request is fulfilled. Mutually exclusive with executionPlan and workflow. -
fulfillmentAutomationLevel (optional, default: 'unspecified'):
'unspecified' | 'manual' | 'semiAutomated' | 'fullyAutomated'The fulfillment automation level for the catalog item -
fulfillmentGroup (optional):
string | Record<'sys_user_group'>The fulfillment group for the catalog item -
hideAddToCart (optional, default: false):
booleanWhether add to cart is hidden for the catalog item -
hideAddToWishList (optional, default: false):
booleanWhether wishlist is hidden for the catalog item -
hideAttachment (optional):
booleanWhether attachments are hidden - cannot be true when mandatoryAttachment is true -
hideDeliveryTime (optional, default: false):
booleanWhether delivery time is hidden for the catalog item -
hideQuantitySelector (optional, default: false):
booleanWhether quantity selector is hidden for the catalog item -
hideSaveAsDraft (optional, default: false):
booleanWhether save as draft is hidden for the catalog item -
hideSP (optional, default: false):
booleanWhether to hide item from Service Portal -
icon (optional):
stringThe icon for the catalog item -
ignorePrice (optional, default: true):
booleanWhether to ignore the price -
image (optional):
stringThe image for the catalog item -
location (optional):
string | Record<'cmn_location'> -
makeItemNonConversational (optional, default: false):
booleanWhether to make the item non conversational -
mandatoryAttachment (optional):
booleanWhether mandatory attachments are required for the catalog item -
meta (optional):
string[]Search tags for the catalog item -
mobileHidePrice (optional, default: false):
booleanWhether to hide the price on mobile -
mobilePicture (optional):
stringThe mobile picture for the catalog item -
mobilePictureType (optional, default: 'desktopPicture'):
'desktopPicture' | 'mobilePicture' | 'noPicture'Whether to use the mobile picture type -
model (optional):
string | Record<'cmdb_model'>The model of the catalog item -
noCart (optional, default: false):
booleanWhether to hide the cart (legacy) -
noOrder (optional, default: false):
booleanWhether to hide the order (legacy) -
noOrderNow (optional, default: false):
booleanWhether to hide the order now (legacy) -
noProceedCheckout (optional, default: false):
booleanWhether to hide the proceed checkout (legacy) -
noQuantity (optional, default: false):
booleanWhether to hide the quantity (legacy) -
noSearch (optional, default: false):
booleanWhether to hide the search (legacy) -
notAvailableFor (optional):
(string | Record<'user_criteria'>)[]The users/groups this item is not available for -
omitPrice (optional, default: false):
booleanWhether to omit the price -
order (optional, default: 0):
numberThe order of the catalog item -
owner (optional):
string | Record<'sys_user'>The owner for the catalog item -
picture (optional):
stringThe picture for the catalog item -
pricingDetails (optional):
PricingDetail[]The pricing details for the catalog item -
recurringFrequency (optional):
FrequencyThe recurring frequency for the catalog item -
requestMethod (optional, default: 'order'):
'order' | 'request' | 'submit'Setting that controls the label displayed for the Order Now button and the order submission experience -
roles (optional):
(string | Role)[]Roles for a catalog item -
shortDescription (optional):
stringA short description of the catalog item -
showVariableHelpOnLoad (optional, default: false):
booleanWhether to show variable help on load -
startClosed (optional, default: false):
booleanWhether to start closed -
state (optional):
StateThe state for the catalog item -
useScLayout (optional, default: true):
booleanWhether to use the service catalog layout -
variables (optional):
Record<string, AnyVariable>The variables for the catalog item -
variableSets (optional):
object[]The variable sets the catalog item belongs to -
vendor (optional):
string | Record<'core_company'> -
version (optional, default: 1):
numberThe version of the catalog item -
view (optional):
string | Record<'sys_ui_view'>The view for the catalog item -
visibleBundle (optional, default: true):
booleanWhether the bundle is visible -
visibleGuide (optional, default: true):
booleanWhether the guide is visible -
visibleStandalone (optional, default: true):
booleanWhether the standalone is visible -
workflow (optional):
string | Record<'wf_workflow'>Workflow that defines how the item request is fulfilled. Mutually exclusive with executionPlan and flow.
See
Examples
Basic CatalogItem
Create a catalog item with checkbox variables and pricing
// Source: packages/api/tests/service-catalog-plugin/fluent/catalog-item-variables/create/checkbox.now.ts
/**
* @title Basic CatalogItem
* @description Create a catalog item with checkbox variables and pricing
*/
import { CatalogItem, CheckboxVariable } from '@servicenow/sdk/core'
export const BasicCatalogItem = CatalogItem({
$id: Now.ID['checkbox_pricing_item'],
name: 'Checkbox Pricing Test',
shortDescription: 'Test checkbox with pricing',
description: 'Catalog item with checkbox variables and pricing details',
flow: '30f3d26187e92300e0ef0cf888cb0b91',
catalogs: ['e0d08b13c3330100c8b837659bba8fb4'],
variables: {
premiumSupport: CheckboxVariable({
question: 'Premium Support',
order: 1,
selectionRequired: true,
pricingDetails: [
{
amount: 100,
currencyType: 'USD',
field: 'price_if_checked',
},
],
}),
rushDelivery: CheckboxVariable({
question: 'Rush Delivery',
order: 2,
selectionRequired: false,
}),
},
})
CatalogItem with Reference Variables
Create a catalog item with reference and requested-for variables
// Source: packages/api/tests/service-catalog-plugin/fluent/catalog-item-variables/create/reference.now.ts
/**
* @title CatalogItem with Reference Variables
* @description Create a catalog item with reference and requested-for variables
*/
import { CatalogItem, ReferenceVariable, RequestedForVariable } from '@servicenow/sdk/core'
export const ReferenceCatalogItem = CatalogItem({
$id: Now.ID['reference_test_item'],
name: 'Reference Test',
shortDescription: 'Test reference variables',
description: 'Catalog item with reference variables',
flow: '30f3d26187e92300e0ef0cf888cb0b91',
catalogs: ['e0d08b13c3330100c8b837659bba8fb4'],
variables: {
simpleRef: ReferenceVariable({
question: 'Simple Reference',
order: 1,
referenceTable: 'sys_user',
referenceQualCondition: 'active=true',
}),
dynamicRef: ReferenceVariable({
question: 'Dynamic Reference',
order: 2,
referenceTable: 'sys_user',
useReferenceQualifier: 'dynamic',
dynamicRefQual: 'c5056264d711210032d7a3b20e610375',
}),
advancedRef: ReferenceVariable({
question: 'Advanced Reference',
order: 3,
referenceTable: 'sys_user',
useReferenceQualifier: 'advanced',
referenceQual: 'active=true',
}),
requestedFor: RequestedForVariable({
question: 'Requested For',
order: 4,
referenceQualCondition: 'active=true',
enableAlsoRequestFor: true,
rolesToUseAlsoRequestFor: ['admin', 'itil'],
}),
},
})
CatalogItem with Multiple Variable Types
Create a catalog item showcasing various variable types
// Source: packages/api/tests/service-catalog-plugin/fluent/catalog-item-variables/create/basic.now.ts
/**
* @title CatalogItem with Multiple Variable Types
* @description Create a catalog item showcasing various variable types
*/
import {
CatalogItem,
CheckboxVariable,
DateVariable,
DateTimeVariable,
EmailVariable,
MultiLineTextVariable,
SelectBoxVariable,
SingleLineTextVariable,
UrlVariable,
YesNoVariable,
} from '@servicenow/sdk/core'
export const MultiVariableCatalogItem = CatalogItem({
$id: Now.ID['software_install_item'],
name: 'Software Installation',
shortDescription: 'Request software installation',
description: 'Use this form to request installation of software on your company device.',
meta: ['software', 'installation', 'IT'],
flow: '30f3d26187e92300e0ef0cf888cb0b91',
variables: {
checkbox: CheckboxVariable({
question: 'Agree to Terms',
order: 1,
pricingDetails: [
{
amount: 100,
currencyType: 'USD',
field: 'price_if_checked',
},
],
}),
date: DateVariable({
question: 'Preferred Install Date',
order: 2,
}),
dateTime: DateTimeVariable({
question: 'Scheduled Date/Time',
order: 3,
}),
email: EmailVariable({
question: 'Contact Email',
order: 4,
}),
multilineText: MultiLineTextVariable({
question: 'Additional Notes',
order: 5,
}),
selectBox: SelectBoxVariable({
question: 'Priority',
order: 6,
choices: {
high: {
label: 'High',
sequence: 1,
inactive: false,
},
medium: {
label: 'Medium',
sequence: 2,
inactive: false,
},
low: {
label: 'Low',
sequence: 3,
inactive: false,
},
},
}),
singleLineText: SingleLineTextVariable({
question: 'Software Name',
order: 7,
}),
url: UrlVariable({
question: 'Software Download URL',
order: 8,
}),
yesNo: YesNoVariable({
question: 'Is this urgent?',
includeNone: true,
order: 9,
}),
},
})