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

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# CatCategory - Scoped

# CatCategory - Scoped {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read  
The CatCategory API provides methods that enable you to create and modify service catalog categories using scripts.

This API runs in the `sn_sc` namespace.  
Important:  
This API is accessible; however, the recommended implementation is the [Service Catalog REST API](https://servicenow-prod.fluidtopics.net/0rEEE3MTCZA2uU1P2mJv5Q#c_ServiceCatalogAPI "The Service Catalog API provides endpoints that access Service Catalog configuration and actions from within a Service Portal.").

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

Adds the Available For user criteria to the current catalog
category.
{#r_CCS-availableForUserCriteria_S_A__table_oz2_pln_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_CCS-availableForUserCriteria_S_A__ul_gc4_bs4_kpb} |
| criteriaIDs | Array | Array of the user criteria sys_ids. |
[Table 1. Parameters]

{#r_CCS-availableForUserCriteria_S_A__table_oz2_pln_vz} {#r_CCS-availableForUserCriteria_S_A__table_pz2_pln_vz__entry__2}

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

{#r_CCS-availableForUserCriteria_S_A__table_pz2_pln_vz}  

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

## CatCategory - canView(Boolean isMobile, String userSysId) {#ariaid-title3}

Determines whether a specified user can view a specified category on a mobile device or
desktop.
{#CCS-canView_B_S__table_j5n_smk_chb__entry__3}

| Name | Type | Description |
|-|-|-|
| isMobile | Boolean | Flag that indicates whether to verify the user for access on a mobile device or desktop. * true: Validate for mobile. * false: Validate for desktop. |
| userSysId | String | Sys_id of the user to validate. |
[Table 3. Parameters]

{#CCS-canView_B_S__table_j5n_smk_chb} {#CCS-canView_B_S__table_k5n_smk_chb__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the user can view the associated category. * true: User can view the category. * false: User cannot view the category. {#CCS-canView_B_S__ul_iwk_ynk_chb} |
[Table 4. Returns]

{#CCS-canView_B_S__table_k5n_smk_chb}  

    var scopedCategoryObj = new sn_sc.CatCategory('7b1262b9530033007444ddeeff7b12ae');
    scopedCategoryObj.canView(false, '62826bf03710200044e0bfc8bcbe5df1');

## CatCategory - create(Boolean standardUpdate) {#ariaid-title4}

Insert the defined category.
{#r_CatCategory-create_Boolean__table_afn_1b2_ns__entry__3}

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

{#r_CatCategory-create_Boolean__table_afn_1b2_ns} {#r_CatCategory-create_Boolean__table_bfn_1b2_ns__entry__2}

| Type | Description |
|-|-|
| String | Sys_id of the inserted variable record. |
[Table 6. Returns]

{#r_CatCategory-create_Boolean__table_bfn_1b2_ns}  

    var categoryCreate = new sn_sc.CatCategory();
    categoryCreate.setAttributes({"title" : "test a scoped category", "sc_catalog" : "e0d08b13c3330100c8b837659bba8fb4"});
    var categorySysId = categoryCreate.create();
    var isValidSysId = categorySysId.match(/^[0-9a-fA-F]{32}$/) == null ? false : true;
    global.Assert.assertEquals(true, isValidSysId,"CategorySysId: ["+ categorySysId +"] is not valid", true, isValidSysId);

## CatCategory - deleteRecord(Boolean standardUpdate) {#ariaid-title5}

Deletes the category record on which the CatCategory class was initially
instantiated.
{#r_CatCategory-deleteRecord_Boolean__table_xzp_4b2_ns__entry__3}

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

{#r_CatCategory-deleteRecord_Boolean__table_xzp_4b2_ns} {#r_CatCategory-deleteRecord_Boolean__table_yzp_4b2_ns__entry__2}

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

{#r_CatCategory-deleteRecord_Boolean__table_yzp_4b2_ns}  

    var categoryDelete = new sn_sc.CatCategory(categorySysId);
    categoryDelete.deleteRecord();
    var category = new sn_sc.CatCategory(categorySysId);
    values = category.read({"title" : "", "sc_catalog":""}, false);
    global.Assert.assertEquals("", values.title,"Category should title");

## CatCategory - getID() {#ariaid-title6}

Returns the sys_id of the current category.
{#CCS-getID__table_db4_h4d_sbb__entry__3}

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

{#CCS-getID__table_db4_h4d_sbb} {#CCS-getID__table_eb4_h4d_sbb__entry__2}

| Type | Description |
|-|-|
| String | Sys_id of the current category. |
[Table 10. Returns]

{#CCS-getID__table_eb4_h4d_sbb}  
Example:

    var cart = new sn_sc.CatCategory("2809952237b1300054b6a3549dbe5dd4");
    var categoryID = cart.getID();
    gs.info(categoryID);

Output:

    2809952237b1300054b6a3549dbe5dd4

## CatCategory - notAvailableForUserCriteria(String action, Array\[\] criteriaIDs) {#ariaid-title7}

Adds the Not Available For user criteria to a catalog
category.
{#r_CCS-notAvailableForUserCriteria_S_A__table_yxb_1mn_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_CCS-notAvailableForUserCriteria_S_A__ul_gc4_bs4_kpb} |
[Table 11. Parameters]

{#r_CCS-notAvailableForUserCriteria_S_A__table_yxb_1mn_vz} {#r_CCS-notAvailableForUserCriteria_S_A__table_zxb_1mn_vz__entry__2}

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

{#r_CCS-notAvailableForUserCriteria_S_A__table_zxb_1mn_vz}  

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

## CatCategory - read(Object columns, Boolean standardUpdate) {#ariaid-title8}

Returns a mapping of the category.
{#r_CatCategory-read_Object_Boolean__table_p2h_5b2_ns__entry__3}

| Name | Type | Description |
|-|-|-|
| columns | Object | Set of columns that you would like the values for. |
| standardUpdate | Boolean | Flag that indicates whether to enable the running of engines and workflow. Valid values: * true: Enable engines and workflow. * false: Do not enable engines and workflow. {#r_CatCategory-read_Object_Boolean__ul_nnx_xwn_kpb} |
[Table 13. Parameters]

{#r_CatCategory-read_Object_Boolean__table_p2h_5b2_ns} {#r_CatCategory-read_Object_Boolean__table_q2h_5b2_ns__entry__2}

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

{#r_CatCategory-read_Object_Boolean__table_q2h_5b2_ns}  

    var category = new sn_sc.CatCategory("a96277509f300200b407b89a442e704e");
    var values = category.read({"title" : ""}, true);
    gs.log(values.title);

## CatCategory - setAttributes(Object attributes) {#ariaid-title9}

Defines the attribute values for this category.
{#r_CatCategory-setAttributes_Object__table_psn_512_ns__entry__3}

| Name | Type | Description |
|-|-|-|
| attributes | Object | Attributes for the new field and value pairs. |
[Table 15. Parameters]

{#r_CatCategory-setAttributes_Object__table_psn_512_ns} {#r_CatCategory-setAttributes_Object__table_qsn_512_ns__entry__2}

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

{#r_CatCategory-setAttributes_Object__table_qsn_512_ns}  

    var categoryCreate = new sn_sc.CatCategory();
    categoryCreate.setAttributes({"title" : "test a scoped category", "sc_catalog" : "e0d08b13c3330100c8b837659bba8fb4"});
    var categorySysId = categoryCreate.create();
    var isValidSysId = categorySysId.match(/^[0-9a-fA-F]{32}$/) == null ? false : true;
    global.Assert.assertEquals(true, isValidSysId,"CategorySysId: ["+ categorySysId +"] is not valid", true, isValidSysId);

## CatCategory - setTableName(String tableName) {#ariaid-title10}

Defines the table name for this category.
{#r_CatCategory-setTableName_String__table_vh4_3dl_qs__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | Name of the table that extends sc_category. |
[Table 17. Parameters]

{#r_CatCategory-setTableName_String__table_vh4_3dl_qs} {#r_CatCategory-setTableName_String__table_wh4_3dl_qs__entry__2}

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

{#r_CatCategory-setTableName_String__table_wh4_3dl_qs}  

    var categoryRead = new sn_sc.CatCategory(categorySysId);
    categoryRead.setTableName("test_category");
    var values = categoryRead.read({"title" : "", "sc_catalog":"", "test": ""}, false);
    gs.info(categorySysId);
    gs.info(values.title);
    gs.info(values.test);
    global.Assert.assertEquals("testValue", values.test,"Category extends sc_category and stores its extended value");

## CatCategory - update(Object columnValues, Boolean standardUpdate) {#ariaid-title11}

Updates the current category with the specified name-value pairs.
{#r_CatCategory-update_Object_Boolean__table_dfz_fb2_ns__entry__3}

| Name | Type | Description |
|-|-|-|
| columnValues | Object | Mapping of column names to values. |
| standardUpdate | Boolean | Flag that indicates whether to enable the running of engines and workflow. Valid values: * true: Enable engines and workflow. * false: Do not enable engines and workflow. {#r_CatCategory-update_Object_Boolean__ul_nnx_xwn_kpb} |
[Table 19. Parameters]

{#r_CatCategory-update_Object_Boolean__table_dfz_fb2_ns} {#r_CatCategory-update_Object_Boolean__table_efz_fb2_ns__entry__2}

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

{#r_CatCategory-update_Object_Boolean__table_efz_fb2_ns}  

    var categoryUpdate = new sn_sc.CatCategory(categorySysId);
    categoryUpdate.update({"title" : "test changed scoped category"}, true);
    values = categoryUpdate.read({"title" : "", "sc_catalog":""}, false);
    global.Assert.assertEquals("test changed scoped category", values.title,"Category should title");


