---
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


---

# CatalogSearch - Scoped

# CatalogSearch - Scoped {#ariaid-title1}

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

The CatalogSearch API provides methods that enable you to search catalog items.

To use this class in a scoped application, use the `sn_sc` namespace
identifier. The Service Catalog Scoped API plugin (ID: com.glideapp.servicecatalog.scoped.api)
that is enabled by default is required to access the CatalogSearch API.

## CatalogSearch - CatalogSearch() {#ariaid-title2}

Creates an instance of the CatalogSearch class.
{#r_CSS-CatalogSearch__table_w4w_r1y_5z__entry__3}

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

{#r_CSS-CatalogSearch__table_w4w_r1y_5z}  

    var catSearchGR = new sn_sc.CatalogSearch().search('', '', 'Apple', false, true);
    catSearchGR.query();
    while(catSearchGR.next()) {
      gs.info(catSearchGR.getValue('name'));
    }

## CatalogSearch - search (String catalogID, String categoryID, String term, Boolean mobile, Boolean noDepthSearch) {#ariaid-title3}

Searches a catalog item based on a search term. The search can be narrowed down to a
catalog category level.
{#r_CSS-search_S_S_S_B_B__table_t55_3by_5z__entry__3}

| Name | Type | Description |
|-|-|-|
| catalogID | String | Identifier of the catalog to search. |
| categoryID | String | Identifier of the catalog category to search. |
| term | String | Search term. |
| mobile | Boolean | Flag that indicates whether catalog items exposed for mobile are searched. Valid values: * true: Search for mobile catalog items. * false: Do not search for mobile catalog items. {#r_CSS-search_S_S_S_B_B__ul_ils_fwq_2pb} |
| noDepthSearch | Boolean | Flag that indicates whether to search subcategories. Valid values: * true: Do not search subcategories. * false: Search subcategories. {#r_CSS-search_S_S_S_B_B__ul_iqz_3wq_2pb} |
[Table 2. Parameters]

{#r_CSS-search_S_S_S_B_B__table_t55_3by_5z} {#r_CSS-search_S_S_S_B_B__table_u55_3by_5z__entry__2}

| Type | Description |
|-|-|
| GlideRecord | Returns the GlideRecord on sc_cat_item matching the search result. |
[Table 3. Returns]

{#r_CSS-search_S_S_S_B_B__table_u55_3by_5z}  
This example shows how to search all catalogs and all categories for term: ServiceNow.

    var now_GR = new sn_sc.CatalogSearch().search('', '', 'ServiceNow', false, false);
    now_GR.query();
    while(now_GR.next()) {
      gs.log(now_GR.name);
    }

Output:

    ServiceNow T-shirt


