{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":976,"path":"api-reference/server-api-reference/c_CatalogSearchScoped.md","title":"CatalogSearch - Scoped","bundle":null,"doc_type":null,"release":"australia","body":"\n# CatalogSearch- Scoped\n\nThe CatalogSearch API provides methods that enable you to search catalog items.\n\nTo 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.\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## CatalogSearch - CatalogSearch\\(\\)\n\nCreates an instance of the CatalogSearch class.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n```\nvar catSearchGR = new sn_sc.CatalogSearch().search('', '', 'Apple', false, true);\ncatSearchGR.query();\nwhile(catSearchGR.next()) {\n  gs.info(catSearchGR.getValue('name'));\n}\n```\n\n## CatalogSearch - search \\(String catalogID, String categoryID, String term, Boolean mobile, Boolean noDepthSearch\\)\n\nSearches a catalog item based on a search term. The search can be narrowed down to a catalog category level.\n\n<table id=\"table_t55_3by_5z\" 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\ncatalogID\n\n</td><td>\n\nString\n\n</td><td>\n\nIdentifier of the catalog to search.\n\n</td></tr><tr><td>\n\ncategoryID\n\n</td><td>\n\nString\n\n</td><td>\n\nIdentifier of the catalog category to search.\n\n</td></tr><tr><td>\n\nterm\n\n</td><td>\n\nString\n\n</td><td>\n\nSearch term.\n\n</td></tr><tr><td>\n\nmobile\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether catalog items exposed for mobile are searched.Valid values:\n\n-   true: Search for mobile catalog items.\n-   false: Do not search for mobile catalog items.\n\n</td></tr><tr><td>\n\nnoDepthSearch\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to search subcategories.Valid values:\n\n-   true: Do not search subcategories.\n-   false: Search subcategories.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|GlideRecord|Returns the GlideRecord on sc\\_cat\\_item matching the search result.|\n\nThis example shows how to search all catalogs and all categories for term: ServiceNow.\n\n```\nvar now_GR = new sn_sc.CatalogSearch().search('', '', 'ServiceNow', false, false);\nnow_GR.query();\nwhile(now_GR.next()) {\n  gs.log(now_GR.name);\n}\n```\n\nOutput:\n\n```\nServiceNow T-shirt\n```\n\n"}}