---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# CatItem - Scoped

# CatItem - Scoped {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 12 minutes to read

The CatItem API provides methods that enable you to create and modify service catalog items using scripts.

This API runs in the `sn_sc` namespace.

## CatItem - availableForUserCriteria(String action, Array criteriaIDs) {#ariaid-title2}

Adds the Available For user criteria to the current catalog
item.
{#r_CIS-availableForUserCriteria_S_A__table_mbk_f5f_vz__entry__3}

| Name | Type | Description |
|-|-|-|
| action | String | Action to perform. * <kbd class="ph userinput">add</kbd>: Adds the user criteria to the Available For list. * <kbd class="ph userinput">delete</kbd>: Deletes the user criteria from the Available For list. {#r_CIS-availableForUserCriteria_S_A__ul_gc4_bs4_kpb} |
| criteriaIDs | Array | Array of the user criteria sys_ids. |
[Table 1. Parameters]

{#r_CIS-availableForUserCriteria_S_A__table_mbk_f5f_vz} {#r_CIS-availableForUserCriteria_S_A__table_nbk_f5f_vz__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 2. Returns]

{#r_CIS-availableForUserCriteria_S_A__table_nbk_f5f_vz}  
This example shows how to add the specified Available For user
criteria.

    var item = new sn_sc.CatItem("31bea3d53790200044e0bfc8bcbe5dec");
    item.availableForUserCriteria("add", ["0c441abbc6112275000025157c651c89"]);

## CatItem - canViewInDomain() {#ariaid-title3}

Verifies whether the current catalog item is viewable in the selected domain (domain
selected in the domain picker).
Catalog items in the global domain are available across all domains.
{#CI-canViewInDomain__table_gww_bbd_thb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 3. Parameters]

{#CI-canViewInDomain__table_gww_bbd_thb} {#CI-canViewInDomain__table_hww_bbd_thb__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that validates whether the current catalog item is viewable in the selected domain. Valid values: * true: Catalog item is viewable in the domain * false: Catalog item is not viewable in the domain {#CI-canViewInDomain__ul_sfm_gdy_shb} |
[Table 4. Returns]

{#CI-canViewInDomain__table_hww_bbd_thb}  
This example shows how to verify whether a catalog item is viewable in the currently
selected domain.

    var catItem = new sn_sc.CatItem("060f3afa3731300054b6a3549dbe5d3e");
    gs.info(catItem.canViewInDomain());

## CatItem - canViewOnSearch(boolean isMobile) {#ariaid-title4}

Determines if the user has access to view the catalog item on global
search.
{#CI-canViewOnSearch_B__table_pqy_zl2_sbb__entry__3}

| Name | Type | Description |
|-|-|-|
| isMobile | Boolean | Flag that indicates whether to perform the search for the mobile or desktop view. Valid values: * true: Perform the search for the mobile view. * false: Perform the search for the desktop view. |
[Table 5. Parameters]

{#CI-canViewOnSearch_B__table_pqy_zl2_sbb} {#CI-canViewOnSearch_B__table_qqy_zl2_sbb__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the user has access to view the catalog item on global search. Valid values: * true: User has access to view the catalog item on global search. * false: User does not have access to view the catalog item on global search. |
[Table 6. Returns]

{#CI-canViewOnSearch_B__table_qqy_zl2_sbb}  
This code example shows how to check if the user has access to view the catalog item on
global search in desktop view.

    var catItem = new sn_sc.CatItem("04b7e94b4f7b4200086eeed18110c7fd");
    var canView = catItem.canViewOnSearch('false');
    gs.info("Can view on global search: " + canView);

Output:

    Can view on global search: true

## CatItem - create(Boolean standardUpdate) {#ariaid-title5}

Inserts the defined catalog item.
{#r_CatItem-create_Boolean__table_uh4_31n_ms__entry__3}

| Name | Type | Description |
|-|-|-|
| standardUpdate | Boolean | Flag that indicates whether to enable the running of engines and workflow. Valid values: * true: Enable the running of engines and workflow. * 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. {#r_CatItem-create_Boolean__ul_olr_kf4_pnb} |
[Table 7. Parameters]

{#r_CatItem-create_Boolean__table_uh4_31n_ms} {#r_CatItem-create_Boolean__table_vh4_31n_ms__entry__2}

| Type | Description |
|-|-|
| String | Sys_id of the newly created catalog item. |
[Table 8. Returns]

{#r_CatItem-create_Boolean__table_vh4_31n_ms}  
This example creates a new catalog item and adds a variable and variable set.

    createCatalogItem('Catalog Item Name', 'Short Description', 'e0d08b13c3330100c8b837659bba8fb4', '109f0438c6112276003ae8ac13e7009d'); 

    function createCatalogItem(name, short_desc, catalogId, categoryId) {
        var catalogItem = new sn_sc.CatItem();
        catalogItem.setAttributes({
            "name": name,
            "short_description": short_desc
        });
        catalogItem.setCatalogs(catalogId); // set catalog
        catalogItem.setCategories(categoryId); // set category

        var catItemSysId = catalogItem.create(); // create new catalog item
        gs.info('Catalog item created in table sc_cat_item with sys_id ' + catItemSysId);

        // add variables and variable set
        addDefaultVariables(catItemSysId);
        addDefaultVariableSet(catItemSysId);
    }

    // creates a new variable and adds it to the catalog item
    function addDefaultVariables(catItemSysId) {
        var myVarAttrs = {
            "type": "6", // type 6 is single line text
            "cat_item": catItemSysId,
            "question_text": "First Name",
            "name": "first_name",
            'order': 50
        };
        var myVar = new sn_sc.CatalogItemVariable();
        myVar.setAttributes(myVarAttrs);
        var varRec = myVar.create(true);
        gs.info('Variable added to catalog item and record created in table item_option_new with sys_id ' + varRec);
    }

    // adds an existing variable set to the catalog item
    function addDefaultVariableSet(catItemSysId) {
        var varset = new sn_sc.CatalogItemVariableSetM2M();
        // fields used in object are from table io_set_item 
        var attr = {
            'variable_set': 'e01cab1a4f334200086eeed18110c71f', // required
            'sc_cat_item': catItemSysId, // required
            'order': 100 // optional
        };
        varset.setAttributes(attr);
        var m2mRec = varset.create(true);
        gs.info('Variable set added to catalog item and M2M record created in table io_set_item with sys_id ' + m2mRec);
    }

Output:

    Catalog item created in table sc_cat_item with sys_id be5c771e876370103a730f2d0ebb3556
    Variable added to catalog item and record created in table item_option_new with sys_id b65cb71e876370103a730f2d0ebb3535
    Variable set added to catalog item and M2M record created in table io_set_item with sys_id 8b5cb71e876370103a730f2d0ebb354b

## CatItem - deleteRecord(Boolean standardUpdate) {#ariaid-title6}

Deletes a catalog item.
{#r_CatItem-delete_Boolean__table_g1q_mfn_ms__entry__3}

| Name | Type | Description |
|-|-|-|
| standardUpdate | Boolean | Flag that indicates whether to enable the running of engines and workflow. Valid values: * true: Enable the running of engines and workflow. * false: Do not enable the running of engines and workflow. |
[Table 9. Parameters]

{#r_CatItem-delete_Boolean__table_g1q_mfn_ms} {#r_CatItem-delete_Boolean__table_h1q_mfn_ms__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 10. Returns]

{#r_CatItem-delete_Boolean__table_h1q_mfn_ms}  
This example deletes all inactive catalog items.

    var catalogItem = new GlideRecord('sc_cat_item');
    catalogItem.addQuery('active', 'false'); // get all inactive catalog items
    catalogItem.query();
    while (catalogItem.next()) {

        // before deleting a catalog item, delete its associated variable set M2M records
        var variableSetM2M = new GlideRecord('io_set_item'); // M2M table linking variable set and catalog item
        variableSetM2M.addQuery('sc_cat_item', catalogItem.getUniqueValue()); // get M2M records for the catalog item
        variableSetM2M.query();
        while (variableSetM2M.next()) {
            var varset = new sn_sc.CatalogItemVariableSetM2M(variableSetM2M.getUniqueValue()); // M2M record sys_id
            varset.deleteRecord(true); // delete M2M record
        }

        // then delete the catalog item
        var item = new sn_sc.CatItem(catalogItem.getUniqueValue()); 
        item.deleteRecord(true);
    }

## CatItem - getFirstAccessibleCategoryForSearch(String catalogId) {#ariaid-title7}

Returns the first category that the user can view in a catalog.
{#CI-getFirstAccessibleCategoryForSearch_S__table_x4w_2g5_qbb__entry__3}

| Name | Type | Description |
|-|-|-|
| catalogId | String | Sys_id of the catalog. |
[Table 11. Parameters]

{#CI-getFirstAccessibleCategoryForSearch_S__table_x4w_2g5_qbb} {#CI-getFirstAccessibleCategoryForSearch_S__table_y4w_2g5_qbb__entry__2}

| Type | Description |
|-|-|
| String | Sys_id of the first category that the user can view in a catalog. |
[Table 12. Returns]

{#CI-getFirstAccessibleCategoryForSearch_S__table_y4w_2g5_qbb}  
Example:

    var CatItem=new sn_sc.CatItem("04b7e94b4f7b4200086eeed18110c7fd");	
    	console.log(CatItem.getFirstAccessibleCategoryForSearch("e0d08b13c3330100c8b837659bba8fb4"));

Output:

    d258b953c611227a0146101fb1be7c31

## CatItem - getInvalidDelegatedUsers(Array requestForUsers) {#ariaid-title8}

Returns an array of users for whom the associated item cannot be delegated (requested
on behalf of).
The method verifies each of the users passed in the array.
{#CI-getInvalidDelegatedUsers_A__table_avj_5n3_nlb__entry__3}

| Name | Type | Description |
|-|-|-|
| requestForUsers | Object | Array 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. User sys_ids are located in the Users \[sys_user\] table. |
[Table 13. Parameters]

{#CI-getInvalidDelegatedUsers_A__table_avj_5n3_nlb} {#CI-getInvalidDelegatedUsers_A__table_bvj_5n3_nlb__entry__2}

| Type | Description |
|-|-|
| Array | List of user names (Name column from Users \[sys_user\] table) for whom the item cannot be requested for by a delegate. |
[Table 14. Returns]

{#CI-getInvalidDelegatedUsers_A__table_bvj_5n3_nlb}  
This example shows how to obtain a list of user names for whom the item cannot be requested
for by a delegate.

    function getInvalidDelegatedUsers(itemId, userIds) {
    var catItem = new sn_sc.CatItem(itemId);
    var invalidUsers = catItem.getInvalidDelegatedUsers(userIds);
    return invalidUsers;
    }

Output:

    [
      "Joe Smith",
      "Jenny Brown",
      "Fred Bennet",
      "Alice Jones"
    ]

## CatItem - getRecordClass() {#ariaid-title9}

Returns the class name for the current catalog item record.
{#CI-getRecordClass__table_jld_nl2_sbb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 15. Parameters]

{#CI-getRecordClass__table_jld_nl2_sbb} {#CI-getRecordClass__table_kld_nl2_sbb__entry__2}

| Type | Description |
|-|-|
| String | Class name for the current catalog item record. |
[Table 16. Returns]

{#CI-getRecordClass__table_kld_nl2_sbb}  
Example:

    var CatItem=new sn_sc.CatItem("04b7e94b4f7b4200086eeed18110c7fd");	
    	console.log(CatItem.getRecordClass());

Output:

    sc_cat_item

## CatItem - isDelegationAllowed(String delegatedUser) {#ariaid-title10}

Verifies whether the specified delegated user has acquisition rights to the current
service catalog item.
{#CI-isDelegationAllowed_S__table_spd_p3q_nlb__entry__3}

| Name | Type | Description |
|-|-|-|
| delegatedUser | String | Optional. 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. |
[Table 17. Parameters]

{#CI-isDelegationAllowed_S__table_spd_p3q_nlb} {#CI-isDelegationAllowed_S__table_tpd_p3q_nlb__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the user has acquisition rights to the current service catalog item. Valid values: * true: User has acquisition rights to the item. * false: User does not have acquisition rights to the item. {#CI-isDelegationAllowed_S__ul_sxh_kqq_nlb} |
[Table 18. Returns]

{#CI-isDelegationAllowed_S__table_tpd_p3q_nlb}  
This code example shows how to determine if delegation is allowed for the catalog item.

    function canRequestFor(itemId, user) {
      var catItem = new sn_sc.CatItem(itemId);
      var result = catItem.isDelegationAllowed(user);
      return result;
    }

Output: true

## CatItem - isVisibleServicePortal() {#ariaid-title11}

Determines if the current catalog item is available in service portal.
{#CI-isVisibleServicePortal__table_rdm_bn2_sbb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 19. Parameters]

{#CI-isVisibleServicePortal__table_rdm_bn2_sbb} {#CI-isVisibleServicePortal__table_sdm_bn2_sbb__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the catalog item is available in the Service Portal. Valid values: * true: Available on Service Portal. * false: Not available on Service Portal. |
[Table 20. Returns]

{#CI-isVisibleServicePortal__table_sdm_bn2_sbb}  
Example:

    var catItem = new sn_sc.CatItem("04b7e94b4f7b4200086eeed18110c7fd");
    var catItemAvail = catItem.isVisibleServicePortal();
    gs.info("Is item available on Service Portal: " + catItemAvail);

Output:

    Is item available on Service Portal: true

## CatItem - notAvailableForUserCriteria(String action, Array criteriaIDs) {#ariaid-title12}

Adds the Not Available For user criteria to a catalog
item.
{#r_CIS-notAvailableForUserCriteria_S_A__table_wdk_tkn_vz__entry__3}

| Name | Type | Description |
|-|-|-|
| action | String | Action to perform. * <kbd class="ph userinput">add</kbd>: Adds the user criteria to the Not Available For list. * <kbd class="ph userinput">delete</kbd>: Deletes the user criteria from the Not Available For list. {#r_CIS-notAvailableForUserCriteria_S_A__ul_gc4_bs4_kpb} |
[Table 21. Parameters]

{#r_CIS-notAvailableForUserCriteria_S_A__table_wdk_tkn_vz} {#r_CIS-notAvailableForUserCriteria_S_A__table_xdk_tkn_vz__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 22. Returns]

{#r_CIS-notAvailableForUserCriteria_S_A__table_xdk_tkn_vz}  
This example shows how to add the specified Not Available For user
criteria.

    var item = new sn_sc.CatItem("31bea3d53790200044e0bfc8bcbe5dec");
    item. notAvailableForUserCriteria("add", ["0c441abbc6112275000025157c651c89"]);

## CatItem - read(Object columns, Boolean standardUpdate) {#ariaid-title13}

Returns a mapping of catalog item attribute values.
{#r_CatItem-read_Object_Boolean__table_hsf_kgn_ms__entry__3}

| Name | Type | Description |
|-|-|-|
| columns | Object | Name-value pairs of columns for which to return values. |
| standardUpdate | Boolean | Flag that indicates whether to enable the running of engines and workflow. Valid values: * true: Enable the running of engines and workflow. * false: Do not enable the running of engines and workflow. {#r_CatItem-read_Object_Boolean__ul_alx_f3p_kpb} |
[Table 23. Parameters]

{#r_CatItem-read_Object_Boolean__table_hsf_kgn_ms} {#r_CatItem-read_Object_Boolean__table_isf_kgn_ms__entry__2}

| Type | Description |
|-|-|
| Object | Mapping of column names to values. |
[Table 24. Returns]

{#r_CatItem-read_Object_Boolean__table_isf_kgn_ms}  
This example reads the name and price fields of a catalog item.

    var catItem = new sn_sc.CatItem("a96277509f300200b407b89a442e704e");
    var values = catItem.read({"name" : "", "price" : ""}, true);
    gs.info("Catalog item name: " + values.name);
    gs.info("Catalog item price: " + values.price);

Output:

    Catalog item name: Standard Laptop
    Catalog item price: 1100

## CatItem - setAttributes(Object attributes) {#ariaid-title14}

Sets attributes for a catalog item.
{#r_CatItem-setAttributes_Object__table_lgj_33n_ms__entry__3}

| Name | Type | Description |
|-|-|-|
| attributes | Object | Name-value pairs of the columns for which to set. |
[Table 25. Parameters]

{#r_CatItem-setAttributes_Object__table_lgj_33n_ms} {#r_CatItem-setAttributes_Object__table_mgj_33n_ms__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 26. Returns]

{#r_CatItem-setAttributes_Object__table_mgj_33n_ms}  
This example sets attributes for a new catalog item.

    createCatalogItem('Name of your Catalog Item', 'Short Description of your Catalog Item', 'e0d08b13c3330100c8b837659bba8fb4', '109f0438c6112276003ae8ac13e7009d'); 

    function createCatalogItem(name, short_desc, catalogId, categoryId) {
        var catalogItem = new sn_sc.CatItem();
        // catalog item column values
        var attributes ={
            "name": name,
            "short_description": short_desc,
    	 "description": "<p>This is a test catalog item.</p>",
    	 "workflow":"0287f2c64a36232700820846b1f8bdce" // sys_id of workflow
        };
        catalogItem.setAttributes(attributes); // set catalog item attributes
        catalogItem.setCatalogs(catalogId); // set catalog
        catalogItem.setCategories(categoryId); // set category

        var catItemSysId = catalogItem.create(); // create new catalog item
        gs.info('Catalog item created in table sc_cat_item with sys_id ' + catItemSysId);
    }

Output:

    Catalog item created in table sc_cat_item with sys_id 706948a287e370103a730f2d0ebb351e

## CatItem - setCatalogs(String catalogs) {#ariaid-title15}

Defines the catalogs that this catalog item is associated with.
{#r_CatItem-setCatalogs_String__table_enx_v3n_ms__entry__3}

| Name | Type | Description |
|-|-|-|
| catalogs | String | Comma-separated list of sys_ids of the catalogs to associate with the item the item. |
[Table 27. Parameters]

{#r_CatItem-setCatalogs_String__table_enx_v3n_ms} {#r_CatItem-setCatalogs_String__table_fnx_v3n_ms__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 28. Returns]

{#r_CatItem-setCatalogs_String__table_fnx_v3n_ms}  
This example associates a catalog item with two catalogs.

    var short_desc = 'This is a short description of my catalog item.';
    var catalogItem = new sn_sc.CatItem();
    catalogItem.setAttributes({
        "name": 'My Catalog Item',
        "short_description": short_desc
    });
    catalogItem.setCatalogs('e0d08b13c3330100c8b837659bba8fb4,742ce428d7211100f2d224837e61036d'); // set Service Catalog and Technical Catalog

    var catItemSysId = catalogItem.create(); // create new catalog item
    gs.info('Catalog item created in table sc_cat_item with sys_id ' + catItemSysId);

Output:

    Catalog item created in table sc_cat_item with sys_id d0c5dcaa872770103a730f2d0ebb35cb

## CatItem - setCategories(String categories) {#ariaid-title16}

Defines the categories that this catalog item is associated with.
{#r_CatItem-setCategories_String__table_c3s_djn_ms__entry__3}

| Name | Type | Description |
|-|-|-|
| categories | String | Comma-separated list of sys_ids of the categories to associate with the item the item. |
[Table 29. Parameters]

{#r_CatItem-setCategories_String__table_c3s_djn_ms} {#r_CatItem-setCategories_String__table_d3s_djn_ms__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 30. Returns]

{#r_CatItem-setCategories_String__table_d3s_djn_ms}  
This example shows how to associate two categories to an item.

    var catItem = new sn_sc.CatItem("060f3afa3731300054b6a3549dbe5d3e");
    catItem.setCatagories("af443cfa5f130100a9ad2572f2b47747", "d467125fd7500200d74460affd6103a1");

## CatItem - setImage(String dbImageSysId, String type) {#ariaid-title17}

Adds an image to a catalog item.
{#r_CatItem-setImage_String_String__table_nwf_kjn_ms__entry__3}

| Name | Type | Description |
|-|-|-|
| dbImageSysId | String | Sys_id of the image from the Images table \[db_image\]. |
| type | String | Type of image. Valid values: * picture * icon {#r_CatItem-setImage_String_String__ul_p4n_ksp_kpb} |
[Table 31. Parameters]

{#r_CatItem-setImage_String_String__table_nwf_kjn_ms} {#r_CatItem-setImage_String_String__table_owf_kjn_ms__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 32. Returns]

{#r_CatItem-setImage_String_String__table_owf_kjn_ms}  
This example adds an image to a catalog item.

    var catItem = new sn_sc.CatItem("1fc0bd968777301093d5ec6d0ebb3548"); // sys_id of catalog item to update
    // update fields if needed
    var attr = {
        'name': 'New Name of Catalog Item - 123',
        'description': '<p>This is an updated description.</p><p> My description new line 1</p><p>My description new line 2</p>',
        'short_description': 'New Short Description of Catalog Item' 
    };
    catItem.update(attr, true);
    catItem.setImage('1b443cfa5f130100a9ad2572f2b47746', 'picture'); // sys_id of image from table db_image

## CatItem - setTableName(String tableName) {#ariaid-title18}

Defines the table name for this catalog item.
{#r_CatItem-setTableName_String__table_yzb_bpd_ns__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | Name of the table that extends Catalog Item \[sc_cat_item\]. |
[Table 33. Parameters]

{#r_CatItem-setTableName_String__table_yzb_bpd_ns} {#r_CatItem-setTableName_String__table_zzb_bpd_ns__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 34. Returns]

{#r_CatItem-setTableName_String__table_zzb_bpd_ns}  
This example shows how to set the name of an extended table.

    var catItem = new sn_sc.CatItem();
    catItem.setTableName("New_catalog_table");

## CatItem - submitProducer(Object values) {#ariaid-title19}

Creates a record using a specified Service Catalog record
producer.
{#CI-submitProducer_O__table_gdj_y4n_crb__entry__3}

| Name | Type | Description |
|-|-|-|
| values | Object | Contains the field values and record producer to use when creating the record. { "variables": {Object}, "sysparm_id": "String" } |
| values.variables | Object | The field values to set for the new record. { "field": "String", "field": "String" } |
| values.sysparm_id | String | Sys_id of the record producer to use from the Record Producer \[sc_cat_item_producer\] table. |
[Table 35. Parameters]

{#CI-submitProducer_O__table_gdj_y4n_crb} {#CI-submitProducer_O__table_hdj_y4n_crb__entry__2}

| Type | Description |
|-|-|
| Object | Contains information about the record that was created. { "number": "String", "parent_id": "String", "parent_table": "String", "record": "String", "redirect_portal_url": "String", "redirect_to": "String", "redirect_url": "String", "sys_id": "String", "table": "String" } |
| \<Object\>.number | Value of the Number field of the created record. Data type: String |
| \<Object\>.parent_id | Sys_id of the parent record. Data type: String |
| \<Object\>.parent_table | The parent table of the table that the record was created in. Data type: String |
| \<Object\>.record | XML of the created record. Data type: String |
| \<Object\>.redirect_portal_url | URL to which to redirect the Service Portal. Data type: String |
| \<Object\>.redirect_to | Redirect value. Data type: String |
| \<Object\>.redirect_url | URL of the created record. Data type: String |
| \<Object\>.sys_id | Sys_id of the created record. Data type: String |
| \<Object\>.table | The table the record was created in. Data type: String |
[Table 36. Returns]

{#CI-submitProducer_O__table_hdj_y4n_crb}  
This example creates an incident using the Create Incident record producer.

    var catalogItem = new sn_sc.CatItem('3f1dd0320a0a0b99000a53f7604a2ef9');  //sys_id of the Create Incident record producer 
    var values = {
       "variables": {"urgency" : "2", "comments" : "Laptop is in a brick state"},
       "sysparm_id": "3f1dd0320a0a0b99000a53f7604a2ef9"
    }
    var targetRecordDetails = catalogItem.submitProducer(values);
    gs.info(JSON.stringify(targetRecordDetails, null, 3));

Output:

    {
       "sys_id": "133b2ee1875f30103a730f2d0ebb35f9",
       "number": "INC0010002",
       "parent_id": null,
       "record": "api/now/table/incident/133b2ee1875f30103a730f2d0ebb35f9",
       "redirect_portal_url": "",
       "parent_table": "task",
       "redirect_url": "incident.do?sys_id=133b2ee1875f30103a730f2d0ebb35f9&sysparm_view=ess",
       "table": "incident",
       "redirect_to": "generated_record"
    }

## CatItem - update(Object columnValues, Boolean standardUpdate) {#ariaid-title20}

Updates the values for specified fields of a catalog item.
{#r_CatItem-update_Object_Boolean__table_uv3_npd_ns__entry__3}

| Name | Type | Description |
|-|-|-|
| columnValues | Object | Name-value pairs of the fields to update and their associated values. |
| standardUpdate | Boolean | Flag that indicates whether to enable the running of engines and workflow. Valid values: * true: Enable the running of engines and workflow. * false: Do not enable the running of engines and workflow. {#r_CatItem-update_Object_Boolean__ul_rpk_xsp_kpb} |
[Table 37. Parameters]

{#r_CatItem-update_Object_Boolean__table_uv3_npd_ns} {#r_CatItem-update_Object_Boolean__table_vv3_npd_ns__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 38. Returns]

{#r_CatItem-update_Object_Boolean__table_vv3_npd_ns}  
This example updates the name, short description, and price of an existing catalog
item.

    var catItem = new sn_sc.CatItem("1fc0bd968777301093d5ec6d0ebb3548"); // sys_id of catalog item to update
    printCatalogItem(); // print current catalog item values
    // object containing fields to update
    var attr = {
        "name": "New Name of Catalog Item",
        "short_description": "New Short Description of Catalog Item", 
        "price": "450"
    };
    catItem.update(attr, true);
    printCatalogItem(); // print new catalog item values

    // prints the name, short description, and price of the catalog item
    function printCatalogItem(){
        // object containing fields to read
        var readValues = {
            "name" : "", 
            "short_description" : "", 
            "price" : ""
        };
        var values = catItem.read(readValues, true); // read the field values
        gs.info("Catalog item name: " + values.name);
        gs.info("Catalog item short description: " + values.short_description);
        gs.info("Catalog item price: " + values.price);
    }

Output:

    Catalog item name: Example Catalog Item
    Catalog item short description: Example Short Description
    Catalog item price: 300
    Catalog item name: New Name of Catalog Item
    Catalog item short description: New Short Description of Catalog Item
    Catalog item price: 450


