{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":2453,"path":"application-development/servicenow-sdk/fluent-service-catalog-api.md","title":"Service Catalog API - ServiceNow Fluent","bundle":null,"doc_type":null,"release":"australia","body":"\n# Service Catalog API - ServiceNow Fluent\n\nThe Service Catalog API defines catalog items \\[sc\\_cat\\_item\\], record producers \\[sc\\_cat\\_item\\_producer\\], and related aspects of service catalogs.\n\n**Note:** For the latest ServiceNow Fluent API documentation and examples, see the [ServiceNow Fluent API reference](https://servicenow.github.io/sdk/category/api-reference) and [ServiceNow SDK examples repository](https://github.com/ServiceNow/sdk-examples) on GitHub.\n\nFor general information about service catalogs, see [Service Catalog](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/service-catalog.md).\n\n**Parent Topic:**[ServiceNow Fluent API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/servicenow-fluent-api-reference.md)\n\n**Related topics**  \n\n\n[ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-fluent.md)\n\n## CatalogItem object\n\nCreate a catalog item \\[sc\\_cat\\_item\\] that users can request from a service catalog.\n\nA catalog item must reference a flow, workflow, or execution plan that defines how the item request is fulfilled.\n\n<table id=\"table_rsp_5rh_33c\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n$id\n\n</td><td>\n\nString or Number\n\n</td><td>\n\nRequired. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys\\_id. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).Format: `Now.ID['String' or Number]`\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. A name for the item that appears in the catalog.\n\n</td></tr><tr><td>\n\nactive\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the item is active and available to be ordered.Default: true\n\n</td></tr><tr><td>\n\navailability\n\n</td><td>\n\nString\n\n</td><td>\n\nThe type of device on which the item displays.Valid values:\n\n-   desktopOnly: The item displays only on desktop devices.\n-   mobileOnly: The item displays only on mobile devices.\n-   both: The item displays on both desktop and mobile devices.\n\nDefault: desktopOnly\n\n</td></tr><tr><td>\n\ncheckedOut\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the item is checked out for editing.Default: false\n\n</td></tr><tr><td>\n\ndescription\n\n</td><td>\n\nString\n\n</td><td>\n\nA detailed description of the item that displays in the catalog when a user selects the item or the associated **Preview** link.You can embed videos, images, links to internal knowledge base \\(KB\\) articles, and links to external sources of information and instruction documentation.\n\n</td></tr><tr><td>\n\nmeta\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of metadata tags used to aid in searches related to the item.**Note:** The meta property is used only for Zing text indexing and search engine and not for AI Search.\n\n</td></tr><tr><td>\n\nmodel\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of a product model \\[cmdb\\_model\\] associated with the item. To define a product model, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\norder\n\n</td><td>\n\nNumber\n\n</td><td>\n\nThe order in which the item appears within its category.Default: 0\n\n</td></tr><tr><td>\n\nowner\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of a user \\[sys\\_user\\] who owns the item and has edit access to it​. To define a user, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\nroles\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of variable identifiers of Role objects or sys\\_ids of roles \\[sys\\_user\\_role\\] that can access the item.​ For more information, see [Role API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/role-api-now-ts.md).\n\n</td></tr><tr><td>\n\nshortDescription\n\n</td><td>\n\nString\n\n</td><td>\n\nA short description of the item that appears on the catalog home page, search results, and the title bar of the order form.\n\n</td></tr><tr><td>\n\nshowVariableHelpOnLoad\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the item displays variable help text by default.Default: false\n\n</td></tr><tr><td>\n\nstartClosed\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to start the item in a collapsed state.Default: false\n\n</td></tr><tr><td>\n\nstate\n\n</td><td>\n\nString\n\n</td><td>\n\nThe publication state of the item, such as draft or published.\n\n</td></tr><tr><td>\n\nvariables\n\n</td><td>\n\nObject\n\n</td><td>\n\nThe variable definitions for the item that provide options for requesting it. Each variable type has a specific function. For example:```javascript\nvariables: {\n    laptopType: SelectBoxVariable({\n      question: \"Laptop Type\",\n      choices: {\n        standard: { label: \"Standard Laptop\", sequence: 1 },\n        developer: { label: \"Developer Workstation\", sequence: 2 }\n      },\n      mandatory: true,\n      order: 100\n    }),\n    justification: MultiLineTextVariable({\n      question: \"Business Justification\",\n      mandatory: true,\n      order: 200\n    })\n}\n```\n\nFor general information about catalog variables, see [Service catalog variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/c_ServiceCatalogVariables.md).\n\n</td></tr><tr><td>\n\nversion\n\n</td><td>\n\nNumber\n\n</td><td>\n\nA version of the item.Default: 1\n\n</td></tr><tr><td>\n\nimage\n\n</td><td>\n\nString\n\n</td><td>\n\nDeprecated. An image for the item.\n\n</td></tr><tr><td>\n\nicon\n\n</td><td>\n\nString\n\n</td><td>\n\nAn image file that displays as an icon beside the item name in the catalog.Use a 27x27 pixel image. If no image is uploaded, the default icon appears.\n\n</td></tr><tr><td>\n\npicture\n\n</td><td>\n\nString\n\n</td><td>\n\nAn image file to display as a picture of the item.\n\n</td></tr><tr><td>\n\nmobilePicture\n\n</td><td>\n\nString\n\n</td><td>\n\nAn image to display as a picture of the item on mobile devices.This property applies only if the value of the mobilePictureType is `mobilePicture`.\n\n</td></tr><tr><td>\n\nmobilePictureType\n\n</td><td>\n\nString\n\n</td><td>\n\nThe type of picture to display for the item on mobile devices.Valid values:\n\n-   desktopPicture: Use the image from the picture property.\n-   mobilePicture: Use the image from the mobilePicture property.\n-   noPicture: The item doesn't display a picture on mobile devices.\n\nDefault: desktopPicture\n\n</td></tr><tr><td>\n\nhideAddToCart\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the **Add to Cart** button.Default: false\n\n</td></tr><tr><td>\n\nhideAddToWishList\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the **Add to Wishlist** button.Default: false\n\n</td></tr><tr><td>\n\nhideDeliveryTime\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the delivery time.Default: false\n\n</td></tr><tr><td>\n\nhideQuantitySelector\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the **Quantity** field.Default: false\n\n</td></tr><tr><td>\n\nhideSaveAsDraft\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the **Save as Draft** button.Default: false\n\n</td></tr><tr><td>\n\nhideSP\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide an item on Service Portal.Default: false\n\n</td></tr><tr><td>\n\nmandatoryAttachment\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to require adding an attachment to submit a request.Default: false\n\n</td></tr><tr><td>\n\nhideAttachment\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the attachment section and not support adding attachments.Default: false\n\n</td></tr><tr><td>\n\nassignedTopics\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of sys\\_ids of existing taxonomy topics that control the visibility of the item in the Employee Center portal. For more information, see [Associate a catalog item with a taxonomy topic in Employee Center](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/associate-cat-item-taxonomy-ec.md).**Note:** This property is available only when the Employee Experience Taxonomy plugin \\(sn\\_ect\\) is active.\n\n</td></tr><tr><td>\n\navailableFor\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of sys\\_ids of user criteria \\[user\\_criteria\\] that define who can access the item.\n\n</td></tr><tr><td>\n\nnotAvailableFor\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of sys\\_ids of user criteria \\[user\\_criteria\\] that define who can't access the item.This property overrides the availableFor property.\n\n</td></tr><tr><td>\n\nvariableSets\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of variable identifiers of VariableSet objects or sys\\_ids of variable sets \\[item\\_option\\_new\\_set\\] to attach to the item. For more information, see [VariableSet object](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md).Format: `{ variableSet, order }`\n\n</td></tr><tr><td>\n\nflow\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier of a Flow object or sys\\_id of a flow \\[sys\\_hub\\_flow\\] that defines how the request is fulfilled. To define a flow, use the [Flow API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-flow-api.md).**Note:** You should use flows as the fulfillment method for catalog items. When flow, workflow, and executionPlan are all specified, the system uses the flow.\n\n</td></tr><tr><td>\n\nexecutionPlan\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of an execution plan \\[sc\\_cat\\_item\\_delivery\\_plan\\] that defines how the request is fulfilled. To define an execution plan, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\nworkflow\n\n</td><td>\n\nString\n\n</td><td>\n\nThe sys\\_id of a legacy workflow \\[wf\\_workflow\\] that defines how the item request is fulfilled. Use the flow property for new implementations.\n\n</td></tr><tr><td>\n\naccessType\n\n</td><td>\n\nString\n\n</td><td>\n\nThe user access required to request the item.Valid values:\n\n-   restricted: Only users who have access to the item can request the item.\n-   delegated: Users who don't have access to the item can request the item on behalf of someone else using the delegated request experience. For more information, see [Delegated request experience](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/delegated-request-exp.md).\n\n**Note:** This functionality is only applicable when the item has a Requested For variable.\n\nDefault: restricted\n\n</td></tr><tr><td>\n\nlocation\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of a location \\[cmn\\_location\\] where the item is provided. To define a location, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\nvendor\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of a vendor associated with the item. To define a vendor, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\ndeliveryPlanScript\n\n</td><td>\n\nScript\n\n</td><td>\n\nDeprecated. Use the executionPlan property instead.\n\n</td></tr><tr><td>\n\ndeliveryTime\n\n</td><td>\n\nObject\n\n</td><td>\n\nThe estimated time to deliver the item.Format: `deliveryTime: { days: Number, hours: Number })`\n\n</td></tr><tr><td>\n\nentitlementScript\n\n</td><td>\n\nScript\n\n</td><td>\n\nA script that defines entitlement for the item.\n\n</td></tr><tr><td>\n\nmakeItemNonConversational\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to prevent the ability to request the item from a conversational experience such as Virtual Agent. If true, the item can be requested from a conversational experience.Default: false\n\n</td></tr><tr><td>\n\nvisibleBundle\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether item is visible in saved bundles.Default: true\n\n</td></tr><tr><td>\n\nvisibleGuide\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether item is visible in order guides.Default: true\n\n</td></tr><tr><td>\n\nvisibleStandalone\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the standalone view is visible.Default: true\n\n</td></tr><tr><td>\n\nfulfillmentAutomationLevel\n\n</td><td>\n\nString\n\n</td><td>\n\nThe level of fulfillment automation for requests.Valid values:\n\n-   unspecified: Automation level of item isn’t specified.\n-   manual: Catalog item isn’t automated.\n-   semiAutomated: Catalog item is semi-automated.\n-   fullyAutomated: Catalog item is automated completely.\n\n</td></tr><tr><td>\n\nfulfillmentGroup\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of the group \\[sys\\_user\\_group\\] responsible for delivering the item. To define a user group, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\ncatalogs\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of sys\\_ids of the catalogs \\[sc\\_catalog\\] in which the item appears.\n\n</td></tr><tr><td>\n\ncategories\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of sys\\_ids of the categories \\[sc\\_category\\] to which the item belongs. A catalog must be specified in the catalogs property before categories can be assigned.In the Service Portal, catalog searches find only items that are assigned to a category. In Employee Center, catalog searches find only items that are associated with a taxonomy topic. For more information, see [Associate a catalog item with a taxonomy topic in Employee Center](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/associate-cat-item-taxonomy-ec.md).\n\n</td></tr><tr><td>\n\ncost\n\n</td><td>\n\nNumber\n\n</td><td>\n\nA number indicating the one-time cost of the item.Default: 0\n\n</td></tr><tr><td>\n\ndisplayPriceProperty\n\n</td><td>\n\nString\n\n</td><td>\n\nThe system property that controls how the item price is displayed.\n\n</td></tr><tr><td>\n\nignorePrice\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the item price in the cart and in the catalog listing.Default: true\n\n</td></tr><tr><td>\n\nmobileHidePrice\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the item price on mobile devices.Default: false\n\n</td></tr><tr><td>\n\nomitPrice\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to omit the price entirely from all views of the item.Default: false\n\n</td></tr><tr><td>\n\nbillable\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the item is billable.Default: false\n\n</td></tr><tr><td>\n\npricingDetails\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of pricing entries for the item. Valid values:\n\n-   price: A one-time price for the item.\n-   recurring\\_price: A price that recurs at a regular interval. When using this value, the recurringFrequency property is required.\n\nFormat: `{ amount, currencyType, field }`\n\n</td></tr><tr><td>\n\nrecurringFrequency\n\n</td><td>\n\nString\n\n</td><td>\n\nThe time interval at which the recurring price repeats, such as monthly or yearly.This property is required when pricingDetails contains a `recurring_price` field entry.\n\n</td></tr><tr><td>\n\nrequestMethod\n\n</td><td>\n\nString\n\n</td><td>\n\nThe label for the submission button and the order submission experience.Valid values:\n\n-   order: Displays an **Order Now** button. A confirmation dialog is shown and delivery information is editable.\n-   request: Displays a **Request** button. A confirmation dialog is shown but delivery information isn’t displayed. Use for scenarios where delivery information is pre-determined, such as a code access request.\n-   submit: Displays a **Submit** button. No confirmation dialog or delivery information is displayed. Use for scenarios where no further request information is required, such as a password reset.\n\nDefault: order\n\n</td></tr><tr><td>\n\ncustomCart\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of a custom UI macro to use for cart rendering. To define a custom cart, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\nuseScLayout\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the item uses the Service Catalog layout for display.Default: true\n\n</td></tr><tr><td>\n\nnoCart\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nDeprecated. Flag that indicates whether to hide the shopping cart.Default: false\n\n</td></tr><tr><td>\n\nnoOrder\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nDeprecated. Flag that indicates whether to hide the **Order** option.Default: false\n\n</td></tr><tr><td>\n\nnoOrderNow\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nDeprecated. Flag that indicates whether to hide the **Order Now** option.Default: false\n\n</td></tr><tr><td>\n\nnoProceedCheckout\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nDeprecated. Flag that indicates whether to hide the checkout process.Default: false\n\n</td></tr><tr><td>\n\nnoQuantity\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nDeprecated. Flag that indicates whether to hide the **Quantity** field.Default: false\n\n</td></tr><tr><td>\n\nnoSearch\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nDeprecated. Flag that indicates whether to hide search.Default: false\n\n</td></tr><tr><td>\n\n$meta\n\n</td><td>\n\nObject\n\n</td><td>\n\nMetadata for the application metadata.With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances.\n\n```javascript\n$meta: {\n      installMethod: 'String'\n}\n```\n\nValid values for installMethod:\n\n-   demo: Outputs the application metadata to the `metadata/unload.demo` directory to be installed with the application when the **Load demo data** option is selected.\n-   first install: Outputs the application metadata to the `metadata/unload` directory to be installed only the first time an application is installed on an instance.\n\n</td></tr></tbody>\n</table>```javascript\nimport { CatalogItem } from \"@servicenow/sdk/core\";\n\nexport const softwareLicenseRequest = CatalogItem({\n  $id: Now.ID[\"software_license_request\"],\n  name: \"Software License Request\",\n  shortDescription: \"Request a software license\",\n\n  catalogs: [serviceCatalog],\n  categories: [softwareCategory],\n\n  // Attach reusable variable sets\n  variableSets: [\n    { variableSet: contactInfoSet, order: 100 },\n    { variableSet: approvalInfoSet, order: 200 }\n  ],\n\n  // Item-specific variables\n  variables: {\n    software_name: SingleLineTextVariable({\n      question: \"Software Name\",\n      mandatory: true,\n      order: 100\n    }),\n    license_type: SelectBoxVariable({\n      question: \"License Type\",\n      choices: {\n        individual: { label: \"Individual\", sequence: 1 },\n        team: { label: \"Team (5 seats)\", sequence: 2 },\n        enterprise: { label: \"Enterprise (unlimited)\", sequence: 3 }\n      },\n      mandatory: true,\n      order: 200\n    }),\n    number_of_licenses: SingleLineTextVariable({\n      question: \"Number of Licenses\",\n      defaultValue: \"1\",\n      order: 300\n    }),\n    justification: MultiLineTextVariable({\n      question: \"Business Justification\",\n      mandatory: true,\n      order: 400\n    })\n  },\n\n  // Pricing with recurring charges\n  pricingDetails: [\n    { amount: 0, currencyType: \"USD\", field: \"price\" },\n    { amount: 99, currencyType: \"USD\", field: \"recurring_price\" }\n  ],\n  recurringFrequency: \"monthly\",\n\n  flow: \"523da512c611228900811a37c97c2014\",\n  deliveryTime: { days: 3, hours: 0 }\n})\n```\n\n## CatalogItemRecordProducer object\n\nCreate a record producer \\[sc\\_cat\\_item\\_producer\\] for users to create task-based records, such as incident or change request records, from the service catalog.\n\nYou can create a record producer for tables and database views that are in the same scope as the record producer. You can also create a record producer for tables that allow create access from applications in other scopes.\n\n<table id=\"table_rsp_5rh_33c\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n$id\n\n</td><td>\n\nString or Number\n\n</td><td>\n\nRequired. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys\\_id. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).Format: `Now.ID['String' or Number]`\n\n</td></tr><tr><td>\n\ntable\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nRequired. The variable identifier of a Table object or name of a table in which the record producer creates records, such as incident or change\\_request.\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. A name for the item that appears in the catalog.\n\n</td></tr><tr><td>\n\nactive\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the item is active and available to be ordered.Default: true\n\n</td></tr><tr><td>\n\navailability\n\n</td><td>\n\nString\n\n</td><td>\n\nThe type of device on which the item displays.Valid values:\n\n-   desktopOnly: The item displays only on desktop devices.\n-   mobileOnly: The item displays only on mobile devices.\n-   both: The item displays on both desktop and mobile devices.\n\nDefault: desktopOnly\n\n</td></tr><tr><td>\n\ncheckedOut\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the item is checked out for editing.Default: false\n\n</td></tr><tr><td>\n\ndescription\n\n</td><td>\n\nString\n\n</td><td>\n\nA detailed description of the item that displays in the catalog when a user selects the item or the associated **Preview** link.You can embed videos, images, links to internal knowledge base \\(KB\\) articles, and links to external sources of information and instruction documentation.\n\n</td></tr><tr><td>\n\nmeta\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of metadata tags used to aid in searches related to the item.**Note:** The meta property is used only for Zing text indexing and search engine and not for AI Search.\n\n</td></tr><tr><td>\n\nmodel\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of a product model \\[cmdb\\_model\\] associated with the item. To define a product model, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\norder\n\n</td><td>\n\nNumber\n\n</td><td>\n\nThe order in which the item appears within its category.Default: 0\n\n</td></tr><tr><td>\n\nowner\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nThe variable identifier or sys\\_id of a user \\[sys\\_user\\] who owns the item and has edit access to it​. To define a user, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).\n\n</td></tr><tr><td>\n\nroles\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of variable identifiers of Role objects or sys\\_ids of roles \\[sys\\_user\\_role\\] that can access the item.​ For more information, see [Role API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/role-api-now-ts.md).\n\n</td></tr><tr><td>\n\nshortDescription\n\n</td><td>\n\nString\n\n</td><td>\n\nA short description of the item that appears on the catalog home page, search results, and the title bar of the order form.\n\n</td></tr><tr><td>\n\nshowVariableHelpOnLoad\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the item displays variable help text by default.Default: false\n\n</td></tr><tr><td>\n\nstartClosed\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to start the item in a collapsed state.Default: false\n\n</td></tr><tr><td>\n\nstate\n\n</td><td>\n\nString\n\n</td><td>\n\nThe publication state of the item, such as draft or published.\n\n</td></tr><tr><td>\n\nvariables\n\n</td><td>\n\nObject\n\n</td><td>\n\nThe variable definitions for the item that provide options for requesting it. Each variable type has a specific function. For example:```javascript\nvariables: {\n    laptopType: SelectBoxVariable({\n      question: \"Laptop Type\",\n      choices: {\n        standard: { label: \"Standard Laptop\", sequence: 1 },\n        developer: { label: \"Developer Workstation\", sequence: 2 }\n      },\n      mandatory: true,\n      order: 100\n    }),\n    justification: MultiLineTextVariable({\n      question: \"Business Justification\",\n      mandatory: true,\n      order: 200\n    })\n}\n```\n\nFor general information about catalog variables, see [Service catalog variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/c_ServiceCatalogVariables.md).\n\n</td></tr><tr><td>\n\nversion\n\n</td><td>\n\nNumber\n\n</td><td>\n\nA version of the item.Default: 1\n\n</td></tr><tr><td>\n\nview\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nRequired. The variable identifier or name of the UI view \\[sys\\_ui\\_view\\] which applies, or the default view. To define a UI view, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).To use the default view \\(`default_view`\\), you must import it:\n\n```javascript\nimport { default_view } from '@servicenow/sdk/core'\n```\n\n</td></tr><tr><td>\n\nicon\n\n</td><td>\n\nString\n\n</td><td>\n\nAn image file that displays as an icon beside the item name in the catalog.Use a 27x27 pixel image. If no image is uploaded, the default icon appears.\n\n</td></tr><tr><td>\n\npicture\n\n</td><td>\n\nString\n\n</td><td>\n\nAn image file to display as a picture of the item.\n\n</td></tr><tr><td>\n\nmobilePicture\n\n</td><td>\n\nString\n\n</td><td>\n\nAn image to display as a picture of the item on mobile devices.This property applies only if the value of the mobilePictureType is `mobilePicture`.\n\n</td></tr><tr><td>\n\nmobilePictureType\n\n</td><td>\n\nString\n\n</td><td>\n\nThe type of picture to display for the item on mobile devices.Valid values:\n\n-   desktopPicture: Use the image from the picture property.\n-   mobilePicture: Use the image from the mobilePicture property.\n-   noPicture: The item doesn't display a picture on mobile devices.\n\nDefault: desktopPicture\n\n</td></tr><tr><td>\n\nassignedTopics\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of sys\\_ids of existing taxonomy topics that control the visibility of the item in the Employee Center portal. For more information, see [Associate a catalog item with a taxonomy topic in Employee Center](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/associate-cat-item-taxonomy-ec.md).**Note:** This property is available only when the Employee Experience Taxonomy plugin \\(sn\\_ect\\) is active.\n\n</td></tr><tr><td>\n\navailableFor\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of sys\\_ids of user criteria \\[user\\_criteria\\] that define who can access the item.\n\n</td></tr><tr><td>\n\nnotAvailableFor\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of sys\\_ids of user criteria \\[user\\_criteria\\] that define who can't access the item.This property overrides the availableFor property.\n\n</td></tr><tr><td>\n\nvariableSets\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of variable identifiers of VariableSet objects or sys\\_ids of variable sets \\[item\\_option\\_new\\_set\\] to attach to the item. For more information, see [VariableSet object](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md).Format: `{ variableSet, order }`\n\n</td></tr><tr><td>\n\nhideAddToCart\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the **Add to Cart** button.Default: false\n\n</td></tr><tr><td>\n\nhideAddToWishList\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the **Add to Wishlist** button.Default: false\n\n</td></tr><tr><td>\n\nhideDeliveryTime\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the delivery time.Default: false\n\n</td></tr><tr><td>\n\nhideQuantitySelector\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the **Quantity** field.Default: false\n\n</td></tr><tr><td>\n\nhideSaveAsDraft\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the **Save as Draft** button.Default: false\n\n</td></tr><tr><td>\n\nhideSP\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide an item on Service Portal.Default: false\n\n</td></tr><tr><td>\n\nmandatoryAttachment\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to require adding an attachment to submit a request.Default: false\n\n</td></tr><tr><td>\n\nhideAttachment\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to hide the attachment section and not support adding attachments.Default: false\n\n</td></tr><tr><td>\n\nallowEdit\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether users can edit the created record after submission.Default: false\n\n</td></tr><tr><td>\n\ncanCancel\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to display a Cancel button on the record producer form. Users can select Cancel to cancel the record producer and return to the last-viewed screen.Default: false\n\n</td></tr><tr><td>\n\npostInsertScript\n\n</td><td>\n\nScript\n\n</td><td>\n\nA server-side script that runs after the record is inserted in the associated table. You can call `current.update()` in this script.**Note:** This script overrides the target record values and record producer template values.\n\nThis property supports inline JavaScript or a reference to another file in the application that contains a script.\n\nFormat:\n\n-   To use text content from another file, refer to a file in the application using the following format: `Now.include('path/to/file')`. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).\n-   To provide an inline script, use string literals or template literals for multiple lines of code: `'Script' or `Script``.\n\nDefault:\n\n```javascript\n/**\n* This script is executed after the record is generated. \n* `current` Is the GlideRecord produced by Record Producer. Use `current.update()` to update the record\n* To access the variables, use `producer.var1` where var1 is the name of the variable\n* To access the Record Producer use `cat_item`\n*/\n```\n\n</td></tr><tr><td>\n\nredirectUrl\n\n</td><td>\n\nString\n\n</td><td>\n\nThe redirect destination after the record is generated.Valid values:\n\n-   generatedRecord: Redirects to the task record created by the record producer.\n-   catalogHomePage: Redirects to the service catalog.\n\nDefault: generatedRecord\n\n</td></tr><tr><td>\n\nsaveOptions\n\n</td><td>\n\nString\n\n</td><td>\n\nAdvanced configuration options for saving the record producer.\n\n</td></tr><tr><td>\n\nsaveScript\n\n</td><td>\n\nScript\n\n</td><td>\n\nA script that runs at every step save in Catalog Builder. This property supports inline JavaScript or a reference to another file in the application that contains a script.Format:\n\n-   To use text content from another file, refer to a file in the application using the following format: `Now.include('path/to/file')`. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).\n-   To provide an inline script, use string literals or template literals for multiple lines of code: `'Script' or `Script``.\n\nDefault:\n\n```javascript\n/**\n* This script is executed at every step save in Catalog Builder. \n* This script is executed before `Script` is executed.\n* `current` Is the GlideRecord produced by Record Producer. \n* To access the variables, use `producer.var1` where var1 is the name of the variable\n* To access the Record Producer use `cat_item`\n*/\n```\n\n</td></tr><tr><td>\n\nscript\n\n</td><td>\n\nScript\n\n</td><td>\n\nA server-side script that runs before the record is created. Use this script to assign values to fields on the record dynamically. Don't call `current.update()` or `current.insert()` in this script.This property supports inline JavaScript or a reference to another file in the application that contains a script.\n\nFormat:\n\n-   To use text content from another file, refer to a file in the application using the following format: `Now.include('path/to/file')`. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).\n-   To provide an inline script, use string literals or template literals for multiple lines of code: `'Script' or `Script``.\n\nDefault:\n\n```javascript\n/** This script is executed before the Record is generated\n* `current`- GlideRecord produced by Record Producer\n* Don't use `current.update()` or `current.insert()` as the record is generated by Record Producer\n* Don't use `current.setValue('sys_class_name', 'xxx')` as this will trigger reparent flow and can cause data loss\n* Avoid `current.setAbortAction()` and generate a separate record\n* Use `producer.var1` to access variables\n*/\n```\n\n</td></tr><tr><td>\n\nimage\n\n</td><td>\n\nString\n\n</td><td>\n\nDeprecated. An image for the item.\n\n</td></tr><tr><td>\n\n$meta\n\n</td><td>\n\nObject\n\n</td><td>\n\nMetadata for the application metadata.With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances.\n\n```javascript\n$meta: {\n      installMethod: 'String'\n}\n```\n\nValid values for installMethod:\n\n-   demo: Outputs the application metadata to the `metadata/unload.demo` directory to be installed with the application when the **Load demo data** option is selected.\n-   first install: Outputs the application metadata to the `metadata/unload` directory to be installed only the first time an application is installed on an instance.\n\n</td></tr></tbody>\n</table>```javascript\nimport { CatalogItemRecordProducer } from \"@servicenow/sdk/core\";\n\nconst serviceCatalog = \"e0d08b13c3330100c8b837659bba8fb4\";\nconst itServicesCategory = \"d258b953c611227a0146101fb1be7c31\";\n\nexport const comprehensiveIncidentProducer = CatalogItemRecordProducer({\n  $id: Now.ID[\"comprehensive_incident_producer\"],\n  name: \"Report Incident with Full Configuration\",\n  shortDescription: \"Complete incident producer with variables and scripts\",\n  table: \"incident\",\n\n  catalogs: [serviceCatalog],\n  categories: [itServicesCategory],\n\n  variables: {\n    short_description: SingleLineTextVariable({\n      question: \"Brief Summary\",\n      mandatory: true,\n      mapToField: true,\n      field: \"short_description\",\n      order: 100\n    }),\n    urgency: SelectBoxVariable({\n      question: \"Urgency\",\n      mandatory: true,\n      mapToField: true,\n      field: \"urgency\",\n      choices: {\n        \"1\": { label: \"High\", sequence: 1 },\n        \"2\": { label: \"Medium\", sequence: 2 },\n        \"3\": { label: \"Low\", sequence: 3 }\n      },\n      order: 200\n    }),\n    assignment_group: ReferenceVariable({\n      question: \"Assignment Group\",\n      mapToField: true,\n      field: \"assignment_group\",\n      referenceTable: \"sys_user_group\",\n      order: 300\n    })\n  },\n\n  script: Now.include(\"../../scripts/rp-pre-insert.js\"),\n  postInsertScript: Now.include(\"../../scripts/rp-post-insert.js\"),\n\n  redirectUrl: \"generatedRecord\",\n  view: \"ess\",\n  allowEdit: true\n})\n```\n\n## CatalogUiPolicy object\n\nConfigure a catalog UI policy \\[catalog\\_ui\\_policy\\] to control variable behavior on catalog item forms based on conditions.\n\nCatalog UI policies can make variables mandatory, read-only, visible, or hidden when specified conditions are met. For validation, calculations, or asynchronous calls, use catalog client scripts instead.\n\n<table id=\"table_rsp_5rh_33c\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n$id\n\n</td><td>\n\nString or Number\n\n</td><td>\n\nRequired. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys\\_id. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).Format: `Now.ID['String' or Number]`\n\n</td></tr><tr><td>\n\nshortDescription\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. A short description of what the catalog UI policy does.\n\n</td></tr><tr><td>\n\ncatalogItem\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nRequired only if the variableSet property isn’t used. The variable identifier of a CatalogItem or CatalogItemRecordProducer object or sys\\_id of the catalog item \\[sc\\_cat\\_item\\] or record producer \\[sc\\_cat\\_item\\_producer\\] to which the UI policy applies. For more information, see [CatalogItem object](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md) or [CatalogItemRecordProducer object](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md).\n\n</td></tr><tr><td>\n\nvariableSet\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nRequired only if the catalogItem property isn’t used. The variable identifier of a VariableSet object or sys\\_id of the variable set \\[item\\_option\\_new\\_set\\] to which the UI policy applies. For more information, see [VariableSet object](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md).\n\n</td></tr><tr><td>\n\nappliesTo\n\n</td><td>\n\nString\n\n</td><td>\n\nThe scope to which the UI policy applies.Valid values:\n\n-   item: The policy applies to a catalog item.\n-   set: The policy applies to a variable set.\n\nDefault: item\n\n</td></tr><tr><td>\n\nactive\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the catalog UI policy is active.Default: true\n\n</td></tr><tr><td>\n\nglobal\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates on which views of the table the Catalog UI Policy runs.Default: true\n\n</td></tr><tr><td>\n\nonLoad\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the catalog UI policy runs when the form loads. If false, the policy applies only when variable values change.Default: true\n\n</td></tr><tr><td>\n\nreverseIfFalse\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to reverse the UI policy actions when the catalog condition evaluates to false.Default: true\n\n</td></tr><tr><td>\n\ninherit\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the Catalog UI Policy is inherited.Default: false\n\n</td></tr><tr><td>\n\nisolateScript\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the policy scripts run in an isolated scope.Default: true\n\n</td></tr><tr><td>\n\ncatalogCondition\n\n</td><td>\n\nString\n\n</td><td>\n\nThe encoded query conditions based on catalog item variable values that trigger the UI policy. For example:```javascript\ncatalogCondition: `${catalogItem.variables.singleLineText}=catalogitem^${catalogItem.variables.reference}ISNOTEMPTY^EQ`\n```\n\n</td></tr><tr><td>\n\nappliesOnCatalogItemView\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the UI policy applies to catalog items displayed in the order screen. This view is available to requesters.Default: true\n\n</td></tr><tr><td>\n\nappliesOnTargetRecord\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the UI policy applies to records created for task-extended tables via record producers.Default: false\n\n</td></tr><tr><td>\n\nappliesOnCatalogTasks\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the UI policy applies to catalog task forms. This view is available to fulfillers.Default: false\n\n</td></tr><tr><td>\n\nappliesOnRequestedItems\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the UI policy applies to requested item forms. This view is available to fulfillers.Default: false\n\n</td></tr><tr><td>\n\nrunScripts\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to run the executeIfTrue and executeIfFalse scripts for this UI policy. Use scripts to apply behaviors beyond read-only, mandatory, or visible, such as targeting a specific role.Default: false\n\n</td></tr><tr><td>\n\nexecuteIfTrue\n\n</td><td>\n\nString\n\n</td><td>\n\nA client-side script that runs when the catalog condition evaluates to true. The script must be wrapped in a `function onCondition() {}` function.\n\n</td></tr><tr><td>\n\nexecuteIfFalse\n\n</td><td>\n\nString\n\n</td><td>\n\nA client-side script that runs when the catalog condition evaluates to false. The script must be wrapped in a `function onCondition() {}` function.\n\n</td></tr><tr><td>\n\nrunScriptsInUiType\n\n</td><td>\n\nString\n\n</td><td>\n\nThe UI type on which the policy scripts run.Valid values:\n\n-   desktop: Scripts run on the desktop interface.\n-   mobileOrServicePortal: Scripts run on the mobile and Service Portal interfaces.\n-   all: Scripts run on all interfaces.\n\nDefault: desktop\n\n</td></tr><tr><td>\n\nvaSupported\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the UI policy is supported in Virtual Agent conversations.Default: false\n\n</td></tr><tr><td>\n\nactions\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of variable actions to perform when the catalog condition is met. For more information, see [actions array](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md).\n\n</td></tr><tr><td>\n\n$meta\n\n</td><td>\n\nObject\n\n</td><td>\n\nMetadata for the application metadata.With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances.\n\n```javascript\n$meta: {\n      installMethod: 'String'\n}\n```\n\nValid values for installMethod:\n\n-   demo: Outputs the application metadata to the `metadata/unload.demo` directory to be installed with the application when the **Load demo data** option is selected.\n-   first install: Outputs the application metadata to the `metadata/unload` directory to be installed only the first time an application is installed on an instance.\n\n</td></tr></tbody>\n</table>```javascript\nimport { CatalogUiPolicy } from \"@servicenow/sdk/core\";\nimport { hardwareRequestItem } from \"./catalog-items/HardwareRequest.now\";\n\nexport const managerApprovalPolicy = CatalogUiPolicy({\n  $id: Now.ID[\"manager_approval_policy\"],\n  shortDescription: \"Show manager approval when high priority selected\",\n  catalogItem: hardwareRequestItem,\n  catalogCondition: `${hardwareRequestItem.variables.priority}=high^EQ`,\n  actions: [\n    {\n      variableName: hardwareRequestItem.variables.manager_approval,\n      visible: true,\n      mandatory: true\n    }\n  ]\n})\n```\n\n### actions array\n\nConfigure the variable actions \\[catalog\\_ui\\_policy\\_action\\] that a catalog UI policy performs on variables when its conditions are met.\n\nEach action in the array specifies a variable and the property changes to apply to that variable when the UI policy condition evaluates to true.\n\n<table id=\"table_pm4_ysh_33c\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nvariableName\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. The variable to which the action applies.\n\n</td></tr><tr><td>\n\nvisible\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to make the variable visible.Default: false\n\n</td></tr><tr><td>\n\ndisabled\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to turn off the variable.Default: false\n\n</td></tr><tr><td>\n\nmandatory\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to make the variable required.Default: false\n\n</td></tr><tr><td>\n\ncleared\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to clear the variable value when the condition is met.Default: false\n\n</td></tr><tr><td>\n\nvariableMessage\n\n</td><td>\n\nString\n\n</td><td>\n\nA message to display on the variable when the condition is met.This property applies only if the variableMessageType property has a value.\n\n</td></tr><tr><td>\n\nvariableMessageType\n\n</td><td>\n\nString\n\n</td><td>\n\nThe type of field message.Valid values:\n\n-   info\n-   warning\n-   error\n\n</td></tr><tr><td>\n\nvalue\n\n</td><td>\n\nString\n\n</td><td>\n\nThe value to set on the variable when the condition is met. This property applies only if the valueAction property is set to `setValue`.\n\n</td></tr><tr><td>\n\nvalueAction\n\n</td><td>\n\nString\n\n</td><td>\n\nThe action to take on the variable value when the condition is met.Valid values:\n\n-   setValue: Sets the variable to the value specified in the value property.\n-   clearValue: Clears the variable value.\n\n</td></tr><tr><td>\n\norder\n\n</td><td>\n\nNumber\n\n</td><td>\n\nThe order in which the action is evaluated relative to other actions.Default: 100\n\n</td></tr><tr><td>\n\nreadOnly\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to make the variable read only.Default: false\n\n</td></tr></tbody>\n</table>```javascript\nactions: [\n    {\n      variableName: laptopRequest.variables.justification,\n      mandatory: true,\n      variableMessage: \"Justification required for urgent requests\",\n      variableMessageType: \"info\",\n      order: 100\n    },\n    {\n      variableName: laptopRequest.variables.manager_approval,\n      visible: true,\n      mandatory: true,\n      order: 200\n    },\n    {\n      variableName: laptopRequest.variables.delivery_date,\n      visible: true,\n      order: 300\n    }\n]\n```\n\n## CatalogClientScript object\n\nConfigure a catalog client script \\[catalog\\_script\\_client\\] that runs on the client side to control the behavior of a catalog item form.\n\nUse catalog client scripts to validate user input, auto-populate fields, or display alerts on catalog item forms. For simple show/hide, mandatory, and read-only logic, use catalog UI policies instead.\n\n<table id=\"table_rsp_5rh_33c\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n$id\n\n</td><td>\n\nString or Number\n\n</td><td>\n\nRequired. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys\\_id. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).Format: `Now.ID['String' or Number]`\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. A unique name for the catalog client script.\n\n</td></tr><tr><td>\n\nscript\n\n</td><td>\n\nScript\n\n</td><td>\n\nThe client-side script to run on the catalog item form. This property supports inline JavaScript or a reference to another file in the application that contains a script.Format:\n\n-   To use text content from another file, refer to a file in the application using the following format: `Now.include('path/to/file')`. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).\n-   To provide an inline script, use string literals or template literals for multiple lines of code: `'Script' or `Script``.\n\n</td></tr><tr><td>\n\ntype\n\n</td><td>\n\nString\n\n</td><td>\n\nThe event that triggers the client script to run.Valid values:\n\n-   onLoad: Runs when the form loads. Use for initial setup such as setting field states, default values, and visibility.\n-   onChange: Runs when a specific variable changes. Include an `if (isLoading) return;` guard.\n-   onSubmit: Runs when the form is submitted. Return `false` to block submission. Avoid using GlideAjax in this type because of asynchronous issues.\n\n</td></tr><tr><td>\n\nuiType\n\n</td><td>\n\nString\n\n</td><td>\n\nThe UI type on which the client script runs.Valid values:\n\n-   desktop: Applies to the desktop interface.\n-   mobileOrServicePortal: Applies to the mobile and Service Portal interfaces.\n-   all: Applies to all interfaces.\n\nDefault: desktop\n\n</td></tr><tr><td>\n\nactive\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the client script is enabled.Default: true\n\n</td></tr><tr><td>\n\nappliesTo\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired if using the variableSet property. The scope to which the catalog client script applies.Valid values:\n\n-   item: The script applies to a catalog item.\n-   set: The script applies to a variable set.\n\nDefault: item\n\n</td></tr><tr><td>\n\ncatalogItem\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nRequired only if the variableSet property isn’t used. The variable identifier of a CatalogItem or CatalogItemRecordProducer object or sys\\_id of the catalog item \\[sc\\_cat\\_item\\] or record producer \\[sc\\_cat\\_item\\_producer\\] to which the client script applies. For more information, see [CatalogItem object](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md) or [CatalogItemRecordProducer object](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md).\n\n</td></tr><tr><td>\n\nvariableSet\n\n</td><td>\n\nReference or String\n\n</td><td>\n\nRequired only if the catalogItem property isn’t used. The variable identifier of a VariableSet object or sys\\_id of the variable set \\[item\\_option\\_new\\_set\\] to which the UI policy applies. For more information, see [VariableSet object](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-service-catalog-api.md).\n\n</td></tr><tr><td>\n\nvariableName\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired if the value of the type property is `onChange`. The name of the catalog variable that triggers the script when its value changes.\n\n</td></tr><tr><td>\n\nappliesOnCatalogItemView\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the client script applies to catalog items displayed in the order screen of the service catalog. This view is available to requesters.Default: true\n\n</td></tr><tr><td>\n\nappliesOnRequestedItems\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the client script applies to requested item forms after the item is requested. This view is available to fulfillers.Default: false\n\n</td></tr><tr><td>\n\nappliesOnCatalogTasks\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the client script applies to catalog task forms for the item. This view is available to fulfillers.Default: false\n\n</td></tr><tr><td>\n\nappliesOnTargetRecord\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the client script applies to records created for task-extended tables via record producers.Default: false\n\n</td></tr><tr><td>\n\nglobal\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the client script runs in the global scope.Default: true\n\n</td></tr><tr><td>\n\nvaSupported\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the client script is supported in Virtual Agent conversations.Default: false\n\n</td></tr><tr><td>\n\npublishedRef\n\n</td><td>\n\nString\n\n</td><td>\n\nThe sys\\_id of a published catalog item \\[sc\\_cat\\_item\\] or record producer \\[sc\\_cat\\_item\\_producer\\] that this client script references.\n\n</td></tr><tr><td>\n\n$meta\n\n</td><td>\n\nObject\n\n</td><td>\n\nMetadata for the application metadata.With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances.\n\n```javascript\n$meta: {\n      installMethod: 'String'\n}\n```\n\nValid values for installMethod:\n\n-   demo: Outputs the application metadata to the `metadata/unload.demo` directory to be installed with the application when the **Load demo data** option is selected.\n-   first install: Outputs the application metadata to the `metadata/unload` directory to be installed only the first time an application is installed on an instance.\n\n</td></tr></tbody>\n</table>```javascript\nimport { CatalogClientScript } from \"@servicenow/sdk/core\";\nimport { laptopRequest } from \"../catalog-items/laptop-request.now\";\n\nCatalogClientScript({\n  $id: Now.ID[\"laptop_onload\"],\n  name: \"Laptop Request - OnLoad\",\n  script: Now.include(\"../../client/laptop-onload.js\"),\n  type: \"onLoad\",\n  catalogItem: laptopRequest,\n  active: true,\n  appliesOnCatalogItemView: true\n});\n```\n\nThe client script is defined in the `laptop-onload.js` file referenced from the script property. For example:\n\n```javascript\nfunction onLoad() {\n  // Set initial field states\n  g_form.setReadOnly(\"estimated_cost\", true);\n  g_form.setValue(\"estimated_cost\", \"$0\");\n  g_form.setMandatory(\"justification\", true);\n}\n```\n\n## VariableSet object\n\nCreate a variable set \\[item\\_option\\_new\\_set\\] that groups reusable variables for use across multiple catalog items and record producers.\n\nVariable sets are reusable collections of variables that can be attached to catalog items and record producers. Catalog UI policies and client scripts can be scoped to a variable set by setting the `appliesTo` property to `set`.\n\n**Note:**\n\n-   Variable sets within a catalog item can’t have the same internal name.\n-   Within a catalog item, the name of a variable can’t be the same as the title or internal name of a variable set.\n-   Catalog client scripts and catalog UI policy scripts must refer to the internal name of a variable set, not the title or display name.\n\n<table id=\"table_rsp_5rh_33c\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n$id\n\n</td><td>\n\nString or Number\n\n</td><td>\n\nRequired. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys\\_id. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).Format: `Now.ID['String' or Number]`\n\n</td></tr><tr><td>\n\ntitle\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. The display title of the variable set. This title appears only if the the displayTitle property is set to true.\n\n</td></tr><tr><td>\n\ninternalName\n\n</td><td>\n\nString\n\n</td><td>\n\nThe internal name of the variable set used for programmatic access through the g\\_form API and server-side scripts. If not provided, the internal name is automatically generated from the title property.\n\n</td></tr><tr><td>\n\ndescription\n\n</td><td>\n\nString\n\n</td><td>\n\nA description of the variable set and its intended use.\n\n</td></tr><tr><td>\n\ntype\n\n</td><td>\n\nString\n\n</td><td>\n\nThe type of the variable set.Valid values:\n\n-   singleRow: Variables are arranged in a single row.\n-   multiRow: Variables are arranged in multiple rows that users can add or remove.\n\nDefault: singleRow\n\n</td></tr><tr><td>\n\nlayout\n\n</td><td>\n\nString\n\n</td><td>\n\nThe column layout for the variable set.Valid values:\n\n-   normal: Variables are displayed in a single column.\n-   2down: Variables are displayed in two columns, one side then the other.\n-   2across: Variables are displayed in two columns with alternating sides.\n\nDefault: normal\n\n</td></tr><tr><td>\n\norder\n\n</td><td>\n\nNumber\n\n</td><td>\n\nThe order in which a variable set displays relative to other variable sets on the form.Default: 100\n\n</td></tr><tr><td>\n\ndisplayTitle\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to display a collapsible section header for the variable set. If true, the value of the title property is displayed as a collapsible header.**Note:** Check box variables are grouped under a default title of Options. To use a custom title, add a Label variable with an order value that places it directly above the check box variables.\n\nDefault: false\n\n</td></tr><tr><td>\n\nsetAttributes\n\n</td><td>\n\nString\n\n</td><td>\n\nAdditional configuration attributes for the variable set as a comma-separated string, such as `max_rows=10,collapsible=true`. Use the `max_rows` attribute to set the maximum number of rows for a multi-row variable set.**Note:** AttachmentVariable, ContainerVariable, HtmlVariable, and CustomVariable types aren’t supported in multi-row variable sets.\n\n</td></tr><tr><td>\n\nreadRoles\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of variable identifiers of Role objects or sys\\_ids of roles \\[sys\\_user\\_role\\] that can view the variable set.​ For more information, see [Role API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/role-api-now-ts.md).\n\n</td></tr><tr><td>\n\nwriteRoles\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of variable identifiers of Role objects or sys\\_ids of roles \\[sys\\_user\\_role\\] that can modify variable values in the set. For more information, see [Role API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/role-api-now-ts.md).\n\n</td></tr><tr><td>\n\ncreateRoles\n\n</td><td>\n\nArray\n\n</td><td>\n\nA list of variable identifiers of Role objects or sys\\_ids of roles \\[sys\\_user\\_role\\] that can create row instances. For more information, see [Role API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/role-api-now-ts.md).This property applies only if the value of the type property is `multiRow`.\n\n</td></tr><tr><td>\n\nvariables\n\n</td><td>\n\nObject\n\n</td><td>\n\nThe variable definitions for the item that provide options for requesting it. Each variable type has a specific function. For example:```javascript\nvariables: {\n    laptopType: SelectBoxVariable({\n      question: \"Laptop Type\",\n      choices: {\n        standard: { label: \"Standard Laptop\", sequence: 1 },\n        developer: { label: \"Developer Workstation\", sequence: 2 }\n      },\n      mandatory: true,\n      order: 100\n    }),\n    justification: MultiLineTextVariable({\n      question: \"Business Justification\",\n      mandatory: true,\n      order: 200\n    })\n}\n```\n\nFor general information about catalog variables, see [Service catalog variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/c_ServiceCatalogVariables.md).\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nString\n\n</td><td>\n\nAn optional name for additional identification of the variable set.\n\n</td></tr><tr><td>\n\nversion\n\n</td><td>\n\nNumber\n\n</td><td>\n\nThe version of the variable set.Default: 0\n\n</td></tr><tr><td>\n\n$meta\n\n</td><td>\n\nObject\n\n</td><td>\n\nMetadata for the application metadata.With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances.\n\n```javascript\n$meta: {\n      installMethod: 'String'\n}\n```\n\nValid values for installMethod:\n\n-   demo: Outputs the application metadata to the `metadata/unload.demo` directory to be installed with the application when the **Load demo data** option is selected.\n-   first install: Outputs the application metadata to the `metadata/unload` directory to be installed only the first time an application is installed on an instance.\n\n</td></tr></tbody>\n</table>```javascript\nimport {\n  VariableSet,\n  EmailVariable,\n  SingleLineTextVariable,\n  ReferenceVariable\n} from \"@servicenow/sdk/core\";\n\nexport const contactInfoSet = VariableSet({\n  $id: Now.ID[\"contact_info_set\"],\n  title: \"Contact Information\",\n  description: \"Standard contact information fields\",\n  type: \"singleRow\",\n  layout: \"2across\",\n  order: 100,\n  displayTitle: true,\n  variables: {\n    email: EmailVariable({\n      question: \"Email Address\",\n      mandatory: true,\n      order: 100\n    }),\n    phone: SingleLineTextVariable({\n      question: \"Phone Number\",\n      mandatory: true,\n      order: 200\n    }),\n    department: ReferenceVariable({\n      question: \"Department\",\n      referenceTable: \"cmn_department\",\n      referenceQualCondition: \"active=true\",\n      order: 300\n    })\n  }\n})\n```\n\n"}}