{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":971,"path":"api-reference/server-api-reference/c_CatItem.md","title":"CatItem - Scoped","bundle":null,"doc_type":null,"release":"australia","body":"\n# CatItem- Scoped\n\nThe CatItem API provides methods that enable you to create and modify service catalog items using scripts.\n\nThis API runs in the `sn_sc` namespace.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## CatItem - availableForUserCriteria\\(String action, Array criteriaIDs\\)\n\nAdds the **Available For** user criteria to the current catalog item.\n\n<table id=\"table_mbk_f5f_vz\" 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\naction\n\n</td><td>\n\nString\n\n</td><td>\n\nAction to perform.-   `add`: Adds the user criteria to the **Available For** list.\n-   `delete`: Deletes the user criteria from the **Available For** list.\n\n</td></tr><tr><td>\n\ncriteriaIDs\n\n</td><td>\n\nArray\n\n</td><td>\n\nArray of the user criteria sys\\_ids.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|void| |\n\nThis example shows how to add the specified **Available For** user criteria.\n\n```\nvar item = new sn_sc.CatItem(\"31bea3d53790200044e0bfc8bcbe5dec\");\nitem.availableForUserCriteria(\"add\", [\"0c441abbc6112275000025157c651c89\"]);\n```\n\n## CatItem - canViewInDomain\\(\\)\n\nVerifies whether the current catalog item is viewable in the selected domain \\(domain selected in the domain picker\\).\n\nCatalog items in the global domain are available across all domains.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_hww_bbd_thb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that validates whether the current catalog item is viewable in the selected domain.Valid values:\n\n -   true: Catalog item is viewable in the domain\n-   false: Catalog item is not viewable in the domain\n\n</td></tr></tbody>\n</table>This example shows how to verify whether a catalog item is viewable in the currently selected domain.\n\n```\nvar catItem = new sn_sc.CatItem(\"060f3afa3731300054b6a3549dbe5d3e\");\ngs.info(catItem.canViewInDomain());\n```\n\n## CatItem - canViewOnSearch\\(boolean isMobile\\)\n\nDetermines if the user has access to view the catalog item on global search.\n\n<table id=\"table_pqy_zl2_sbb\" 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\nisMobile\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to perform the search for the mobile or desktop view.\n\n Valid values:\n\n-   true: Perform the search for the mobile view.\n-   false: Perform the search for the desktop view.\n\n</td></tr></tbody>\n</table><table id=\"table_qqy_zl2_sbb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the user has access to view the catalog item on global search.\n\n Valid values:\n\n-   true: User has access to view the catalog item on global search.\n-   false: User does not have access to view the catalog item on global search.\n\n</td></tr></tbody>\n</table>This code example shows how to check if the user has access to view the catalog item on global search in desktop view.\n\n```\nvar catItem = new sn_sc.CatItem(\"04b7e94b4f7b4200086eeed18110c7fd\");\nvar canView = catItem.canViewOnSearch('false');\ngs.info(\"Can view on global search: \" + canView);\n```\n\nOutput:\n\n```\nCan view on global search: true\n```\n\n## CatItem - create\\(Boolean standardUpdate\\)\n\nInserts the defined catalog item.\n\n<table id=\"table_uh4_31n_ms\" 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\nstandardUpdate\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to enable the running of engines and workflow.Valid values:\n\n-   true: Enable the running of engines and workflow.\n-   false: Do not enable the running of engines and workflow. Note that the created and updated system date columns on the table are not updated.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|String|Sys\\_id of the newly created catalog item.|\n\nThis example creates a new catalog item and adds a variable and variable set.\n\n```\ncreateCatalogItem('Catalog Item Name', 'Short Description', 'e0d08b13c3330100c8b837659bba8fb4', '109f0438c6112276003ae8ac13e7009d'); \n\nfunction createCatalogItem(name, short_desc, catalogId, categoryId) {\n    var catalogItem = new sn_sc.CatItem();\n    catalogItem.setAttributes({\n        \"name\": name,\n        \"short_description\": short_desc\n    });\n    catalogItem.setCatalogs(catalogId); // set catalog\n    catalogItem.setCategories(categoryId); // set category\n\n    var catItemSysId = catalogItem.create(); // create new catalog item\n    gs.info('Catalog item created in table sc_cat_item with sys_id ' + catItemSysId);\n\n    // add variables and variable set\n    addDefaultVariables(catItemSysId);\n    addDefaultVariableSet(catItemSysId);\n}\n\n// creates a new variable and adds it to the catalog item\nfunction addDefaultVariables(catItemSysId) {\n    var myVarAttrs = {\n        \"type\": \"6\", // type 6 is single line text\n        \"cat_item\": catItemSysId,\n        \"question_text\": \"First Name\",\n        \"name\": \"first_name\",\n        'order': 50\n    };\n    var myVar = new sn_sc.CatalogItemVariable();\n    myVar.setAttributes(myVarAttrs);\n    var varRec = myVar.create(true);\n    gs.info('Variable added to catalog item and record created in table item_option_new with sys_id ' + varRec);\n}\n\n// adds an existing variable set to the catalog item\nfunction addDefaultVariableSet(catItemSysId) {\n    var varset = new sn_sc.CatalogItemVariableSetM2M();\n    // fields used in object are from table io_set_item \n    var attr = {\n        'variable_set': 'e01cab1a4f334200086eeed18110c71f', // required\n        'sc_cat_item': catItemSysId, // required\n        'order': 100 // optional\n    };\n    varset.setAttributes(attr);\n    var m2mRec = varset.create(true);\n    gs.info('Variable set added to catalog item and M2M record created in table io_set_item with sys_id ' + m2mRec);\n}\n```\n\nOutput:\n\n```\nCatalog item created in table sc_cat_item with sys_id be5c771e876370103a730f2d0ebb3556\nVariable added to catalog item and record created in table item_option_new with sys_id b65cb71e876370103a730f2d0ebb3535\nVariable set added to catalog item and M2M record created in table io_set_item with sys_id 8b5cb71e876370103a730f2d0ebb354b\n```\n\n## CatItem - deleteRecord\\(Boolean standardUpdate\\)\n\nDeletes a catalog item.\n\n<table id=\"table_g1q_mfn_ms\" 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\nstandardUpdate\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to enable the running of engines and workflow.Valid values:\n\n-   true: Enable the running of engines and workflow.\n-   false: Do not enable the running of engines and workflow.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|void| |\n\nThis example deletes all inactive catalog items.\n\n```\nvar catalogItem = new GlideRecord('sc_cat_item');\ncatalogItem.addQuery('active', 'false'); // get all inactive catalog items\ncatalogItem.query();\nwhile (catalogItem.next()) {\n\n    // before deleting a catalog item, delete its associated variable set M2M records\n    var variableSetM2M = new GlideRecord('io_set_item'); // M2M table linking variable set and catalog item\n    variableSetM2M.addQuery('sc_cat_item', catalogItem.getUniqueValue()); // get M2M records for the catalog item\n    variableSetM2M.query();\n    while (variableSetM2M.next()) {\n        var varset = new sn_sc.CatalogItemVariableSetM2M(variableSetM2M.getUniqueValue()); // M2M record sys_id\n        varset.deleteRecord(true); // delete M2M record\n    }\n\n    // then delete the catalog item\n    var item = new sn_sc.CatItem(catalogItem.getUniqueValue()); \n    item.deleteRecord(true);\n}\n```\n\n## CatItem - getFirstAccessibleCategoryForSearch\\(String catalogId\\)\n\nReturns the first category that the user can view in a catalog.\n\n|Name|Type|Description|\n|----|----|-----------|\n|catalogId|String|Sys\\_id of the catalog.|\n\n|Type|Description|\n|----|-----------|\n|String|Sys\\_id of the first category that the user can view in a catalog.|\n\nExample:\n\n```\nvar CatItem=new sn_sc.CatItem(\"04b7e94b4f7b4200086eeed18110c7fd\");\t\n\tconsole.log(CatItem.getFirstAccessibleCategoryForSearch(\"e0d08b13c3330100c8b837659bba8fb4\"));\n```\n\nOutput:\n\n```\nd258b953c611227a0146101fb1be7c31\n```\n\n## CatItem - getInvalidDelegatedUsers\\(Array requestForUsers\\)\n\nReturns an array of users for whom the associated item cannot be delegated \\(requested on behalf of\\).\n\nThe method verifies each of the users passed in the array.\n\n<table id=\"table_avj_5n3_nlb\" 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\nrequestForUsers\n\n</td><td>\n\nObject\n\n</td><td>\n\nArray of user sys\\_ids to check whether the associated user can acquire the current item and that the item can be requested on behalf of them.Table: User \\[sys\\_user\\]\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|Array|List of user names \\(Name column from Users \\[sys\\_user\\] table\\) for whom the item can't be requested for by a delegate.|\n\nThis example shows how to obtain a list of user names for whom the item can't be requested for by a delegate.\n\n```\nfunction getInvalidDelegatedUsers(itemId, userIds) {\nvar catItem = new sn_sc.CatItem(itemId);\nvar invalidUsers = catItem.getInvalidDelegatedUsers(userIds);\nreturn invalidUsers;\n}\n```\n\nOutput:\n\n```\n[\n  \"Joe Smith\",\n  \"Jenny Brown\",\n  \"Fred Bennet\",\n  \"Alice Jones\"\n]\n```\n\n## CatItem - getRecordClass\\(\\)\n\nReturns the class name for the current catalog item record.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Class name for the current catalog item record.|\n\nExample:\n\n```\nvar CatItem=new sn_sc.CatItem(\"04b7e94b4f7b4200086eeed18110c7fd\");\t\n\tconsole.log(CatItem.getRecordClass());\n```\n\nOutput:\n\n```\nsc_cat_item\n```\n\n## CatItem - isDelegationAllowed\\(String delegatedUser\\)\n\nVerifies whether the specified delegated user has acquisition rights to the current service catalog item.\n\n<table id=\"table_spd_p3q_nlb\" 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\ndelegatedUser\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Sys\\_id of the user to request the service catalog item for \\(delegate\\). The method verifies whether the user has acquisition rights to the item.Default: Checks whether the calling user has acquisition rights to the item.\n\n</td></tr></tbody>\n</table><table id=\"table_tpd_p3q_nlb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the user has acquisition rights to the current service catalog item.Valid values:\n\n-   true: User has acquisition rights to the item.\n-   false: User does not have acquisition rights to the item.\n\n</td></tr></tbody>\n</table>This code example shows how to determine if delegation is allowed for the catalog item.\n\n```\nfunction canRequestFor(itemId, user) {\n  var catItem = new sn_sc.CatItem(itemId);\n  var result = catItem.isDelegationAllowed(user);\n  return result;\n}\n```\n\nOutput: true\n\n## CatItem - isVisibleServicePortal\\(\\)\n\nDetermines if the current catalog item is available in service portal.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_sdm_bn2_sbb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the catalog item is available in the Service Portal.\n\n Valid values:\n\n-   true: Available on Service Portal.\n-   false: Not available on Service Portal.\n\n</td></tr></tbody>\n</table>Example:\n\n```\nvar catItem = new sn_sc.CatItem(\"04b7e94b4f7b4200086eeed18110c7fd\");\nvar catItemAvail = catItem.isVisibleServicePortal();\ngs.info(\"Is item available on Service Portal: \" + catItemAvail);\n```\n\nOutput:\n\n```\nIs item available on Service Portal: true\n```\n\n## CatItem - notAvailableForUserCriteria\\(String action, Array criteriaIDs\\)\n\nAdds the **Not Available For** user criteria to a catalog item.\n\n<table id=\"table_wdk_tkn_vz\" 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\naction\n\n</td><td>\n\nString\n\n</td><td>\n\nAction to perform.-   `add`: Adds the user criteria to the **Not Available For** list.\n-   `delete`: Deletes the user criteria from the **Not Available For** list.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|void| |\n\nThis example shows how to add the specified **Not Available For** user criteria.\n\n```\nvar item = new sn_sc.CatItem(\"31bea3d53790200044e0bfc8bcbe5dec\");\nitem. notAvailableForUserCriteria(\"add\", [\"0c441abbc6112275000025157c651c89\"]);\n```\n\n## CatItem - read\\(Object columns, Boolean standardUpdate\\)\n\nReturns a mapping of catalog item attribute values.\n\n<table id=\"table_hsf_kgn_ms\" 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\ncolumns\n\n</td><td>\n\nObject\n\n</td><td>\n\nName-value pairs of columns for which to return values.\n\n</td></tr><tr><td>\n\nstandardUpdate\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to enable the running of engines and workflow.Valid values:\n\n-   true: Enable the running of engines and workflow.\n-   false: Do not enable the running of engines and workflow.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|Object|Mapping of column names to values.|\n\nThis example reads the name and price fields of a catalog item.\n\n```\nvar catItem = new sn_sc.CatItem(\"a96277509f300200b407b89a442e704e\");\nvar values = catItem.read({\"name\" : \"\", \"price\" : \"\"}, true);\ngs.info(\"Catalog item name: \" + values.name);\ngs.info(\"Catalog item price: \" + values.price);\n```\n\nOutput:\n\n```\nCatalog item name: Standard Laptop\nCatalog item price: 1100\n```\n\n## CatItem - setAttributes\\(Object attributes\\)\n\nSets attributes for a catalog item.\n\n|Name|Type|Description|\n|----|----|-----------|\n|attributes|Object|Name-value pairs of the columns for which to set.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\nThis example sets attributes for a new catalog item.\n\n```\ncreateCatalogItem('Name of your Catalog Item', 'Short Description of your Catalog Item', 'e0d08b13c3330100c8b837659bba8fb4', '109f0438c6112276003ae8ac13e7009d'); \n\nfunction createCatalogItem(name, short_desc, catalogId, categoryId) {\n    var catalogItem = new sn_sc.CatItem();\n    // catalog item column values\n    var attributes ={\n        \"name\": name,\n        \"short_description\": short_desc,\n\t \"description\": \"<p>This is a test catalog item.</p>\",\n\t \"workflow\":\"0287f2c64a36232700820846b1f8bdce\" // sys_id of workflow\n    };\n    catalogItem.setAttributes(attributes); // set catalog item attributes\n    catalogItem.setCatalogs(catalogId); // set catalog\n    catalogItem.setCategories(categoryId); // set category\n\n    var catItemSysId = catalogItem.create(); // create new catalog item\n    gs.info('Catalog item created in table sc_cat_item with sys_id ' + catItemSysId);\n}\n```\n\nOutput:\n\n```\nCatalog item created in table sc_cat_item with sys_id 706948a287e370103a730f2d0ebb351e\n```\n\n## CatItem - setCatalogs\\(String catalogs\\)\n\nDefines the catalogs that this catalog item is associated with.\n\n|Name|Type|Description|\n|----|----|-----------|\n|catalogs|String|Comma-separated list of sys\\_ids of the catalogs to associate with the item the item.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\nThis example associates a catalog item with two catalogs.\n\n```\nvar short_desc = 'This is a short description of my catalog item.';\nvar catalogItem = new sn_sc.CatItem();\ncatalogItem.setAttributes({\n    \"name\": 'My Catalog Item',\n    \"short_description\": short_desc\n});\ncatalogItem.setCatalogs('e0d08b13c3330100c8b837659bba8fb4,742ce428d7211100f2d224837e61036d'); // set Service Catalog and Technical Catalog\n\nvar catItemSysId = catalogItem.create(); // create new catalog item\ngs.info('Catalog item created in table sc_cat_item with sys_id ' + catItemSysId);\n```\n\nOutput:\n\n```\nCatalog item created in table sc_cat_item with sys_id d0c5dcaa872770103a730f2d0ebb35cb\n```\n\n## CatItem - setCategories\\(String categories\\)\n\nDefines the categories that this catalog item is associated with.\n\n|Name|Type|Description|\n|----|----|-----------|\n|categories|String|Comma-separated list of sys\\_ids of the categories to associate with the item the item.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\nThis example shows how to associate two categories to an item.\n\n```\nvar catItem = new sn_sc.CatItem(\"060f3afa3731300054b6a3549dbe5d3e\");\ncatItem.setCatagories(\"af443cfa5f130100a9ad2572f2b47747\", \"d467125fd7500200d74460affd6103a1\");\n```\n\n## CatItem - setImage\\(String dbImageSysId, String type\\)\n\nAdds an image to a catalog item.\n\n<table id=\"table_nwf_kjn_ms\" 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\ndbImageSysId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the image from the Images table \\[db\\_image\\].\n\n</td></tr><tr><td>\n\ntype\n\n</td><td>\n\nString\n\n</td><td>\n\nType of image. Valid values:\n\n-   picture\n-   icon\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|void| |\n\nThis example adds an image to a catalog item.\n\n```\nvar catItem = new sn_sc.CatItem(\"1fc0bd968777301093d5ec6d0ebb3548\"); // sys_id of catalog item to update\n// update fields if needed\nvar attr = {\n    'name': 'New Name of Catalog Item - 123',\n    'description': '<p>This is an updated description.</p><p> My description new line 1</p><p>My description new line 2</p>',\n    'short_description': 'New Short Description of Catalog Item' \n};\ncatItem.update(attr, true);\ncatItem.setImage('1b443cfa5f130100a9ad2572f2b47746', 'picture'); // sys_id of image from table db_image\n\n```\n\n## CatItem - setTableName\\(String tableName\\)\n\nDefines the table name for this catalog item.\n\n|Name|Type|Description|\n|----|----|-----------|\n|tableName|String|Name of the table that extends Catalog Item \\[sc\\_cat\\_item\\].|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\nThis example shows how to set the name of an extended table.\n\n```\nvar catItem = new sn_sc.CatItem();\ncatItem.setTableName(\"New_catalog_table\");\n```\n\n## CatItem - submitProducer\\(Object values\\)\n\nCreates a record using a specified Service Catalog record producer.\n\n<table id=\"table_gdj_y4n_crb\" 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\nvalues\n\n</td><td>\n\nObject\n\n</td><td>\n\nContains the field values and record producer to use when creating the record.```\n{\n  \"variables\": {Object},\n  \"sysparm_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nvalues.variables\n\n</td><td>\n\nObject\n\n</td><td>\n\nThe field values to set for the new record.```\n{\n   \"field\": \"String\",\n   \"field\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nvalues.sysparm\\_id\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the record producer to use from the Record Producer \\[sc\\_cat\\_item\\_producer\\] table.\n\n</td></tr></tbody>\n</table><table id=\"table_hdj_y4n_crb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nObject\n\n</td><td>\n\nContains information about the record that was created.```\n{\n   \"number\": \"String\",\n   \"parent_id\": \"String\",\n   \"parent_table\": \"String\",\n   \"record\": \"String\",\n   \"redirect_portal_url\": \"String\",\n   \"redirect_to\": \"String\",\n   \"redirect_url\": \"String\",\n   \"sys_id\": \"String\",\n   \"table\": \"String\"\t\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.number\n\n</td><td>\n\nValue of the **Number** field of the created record.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.parent\\_id\n\n</td><td>\n\nSys\\_id of the parent record.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.parent\\_table\n\n</td><td>\n\nThe parent table of the table that the record was created in.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.record\n\n</td><td>\n\nXML of the created record.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.redirect\\_portal\\_url\n\n</td><td>\n\nURL to which to redirect the Service Portal.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.redirect\\_to\n\n</td><td>\n\nRedirect value.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.redirect\\_url\n\n</td><td>\n\nURL of the created record.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.sys\\_id\n\n</td><td>\n\nSys\\_id of the created record.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.table\n\n</td><td>\n\nThe table the record was created in.Data type: String\n\n</td></tr></tbody>\n</table>This example creates an incident using the Create Incident record producer.\n\n```\nvar catalogItem = new sn_sc.CatItem('3f1dd0320a0a0b99000a53f7604a2ef9');  //sys_id of the Create Incident record producer \nvar values = {\n   \"variables\": {\"urgency\" : \"2\", \"comments\" : \"Laptop is in a brick state\"},\n   \"sysparm_id\": \"3f1dd0320a0a0b99000a53f7604a2ef9\"\n}\nvar targetRecordDetails = catalogItem.submitProducer(values);\ngs.info(JSON.stringify(targetRecordDetails, null, 3));\n```\n\nOutput:\n\n```\n{\n   \"sys_id\": \"133b2ee1875f30103a730f2d0ebb35f9\",\n   \"number\": \"INC0010002\",\n   \"parent_id\": null,\n   \"record\": \"api/now/table/incident/133b2ee1875f30103a730f2d0ebb35f9\",\n   \"redirect_portal_url\": \"\",\n   \"parent_table\": \"task\",\n   \"redirect_url\": \"incident.do?sys_id=133b2ee1875f30103a730f2d0ebb35f9&sysparm_view=ess\",\n   \"table\": \"incident\",\n   \"redirect_to\": \"generated_record\"\n}\n```\n\n## CatItem - update\\(Object columnValues, Boolean standardUpdate\\)\n\nUpdates the values for specified fields of a catalog item.\n\n<table id=\"table_uv3_npd_ns\" 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\ncolumnValues\n\n</td><td>\n\nObject\n\n</td><td>\n\nName-value pairs of the fields to update and their associated values.\n\n</td></tr><tr><td>\n\nstandardUpdate\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to enable the running of engines and workflow.Valid values:\n\n-   true: Enable the running of engines and workflow.\n-   false: Do not enable the running of engines and workflow.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|void| |\n\nThis example updates the name, short description, and price of an existing catalog item.\n\n```\nvar catItem = new sn_sc.CatItem(\"1fc0bd968777301093d5ec6d0ebb3548\"); // sys_id of catalog item to update\nprintCatalogItem(); // print current catalog item values\n// object containing fields to update\nvar attr = {\n    \"name\": \"New Name of Catalog Item\",\n    \"short_description\": \"New Short Description of Catalog Item\", \n    \"price\": \"450\"\n};\ncatItem.update(attr, true);\nprintCatalogItem(); // print new catalog item values\n\n// prints the name, short description, and price of the catalog item\nfunction printCatalogItem(){\n    // object containing fields to read\n    var readValues = {\n        \"name\" : \"\", \n        \"short_description\" : \"\", \n        \"price\" : \"\"\n    };\n    var values = catItem.read(readValues, true); // read the field values\n    gs.info(\"Catalog item name: \" + values.name);\n    gs.info(\"Catalog item short description: \" + values.short_description);\n    gs.info(\"Catalog item price: \" + values.price);\n}\n```\n\nOutput:\n\n```\nCatalog item name: Example Catalog Item\nCatalog item short description: Example Short Description\nCatalog item price: 300\nCatalog item name: New Name of Catalog Item\nCatalog item short description: New Short Description of Catalog Item\nCatalog item price: 450\n```\n\n"}}