How to troubleshoot common Service Portal customization issuesSummary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Troubleshoot common Service Portal issues that may result from customization, including portal search failures, widget errors, cloned widget failures, and knowledge portal widget issues. This article covers the following scenarios: Portal search does not return expected resultsA page displays an error for a failing widgetA cloned widget does not function correctly Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All supported releases Instructions<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Service Portal architecture overview Service Portal consists of these components: Portal configurationPagesWidgetsWidget instances Issue 1: Portal search does not return expected results Verify search configuration Open the portal record and check the Search Sources related list for the search source configuration.Verify that the correct knowledge base and catalog types are defined in the Knowledge Bases & Catalogs related list.For catalog items, confirm that the item is visible in Service Portal. Add the Hide on Service Portal column to the Catalog Item [sc_cat_item] list to check whether the value is set to true or false.Verify that tables are indexed regularly.If a search term does not return results in Service Portal, search for the same term in the platform UI and compare the results. Validate user access to content If portal search with custom widgets does not display specific articles or catalog items that appear elsewhere, validate whether the user has access to the content. Capture the name of the record the user is searching for.Identify the user who is performing the search.Identify the article or catalog item that does not appear in search results.Go to Service Catalog > User Criteria Diagnostics or Knowledge > User Criteria Diagnostics. If the user has access to the article or item and it appears in the platform UI, the issue is likely in the widget code that queries the tables to retrieve records. Use the following steps to confirm. Test record accessibility in the portal Get the sys_id of the article or item that does not appear in search results.In the portal, open any article or item that the user can access and that appears in search results.Copy the sys_id from the URL of the displayed record.Replace the sys_id in the URL with the sys_id from step 1 and check whether the record displays. If the record displays, the widget code needs to be debugged.If the record does not display, the issue may be related to an Access Control List (ACL) or business rule. Use User Criteria Diagnostics to validate. Issue 2: Page displays an error for a failing widget Error example: Determine whether the widget is a customized or default widget.If the widget is customized, check whether a default widget can achieve the same functionality.Try deactivating scripts or removing variables one at a time to identify which one causes the widget to fail. Another cause may be invalid variables or variables within a variable set in the catalog item. A variable is considered invalid in the following situations: A reference field points to a table that does not exist. This can occur if the catalog item was moved from another instance through an update set or XML import.Variables have duplicate names.A UI policy or policy action references a variable that does not exist in the catalog item.Containers are placed incorrectly. Issue 3: Cloned widget does not function correctly Verify that the dependencies, including Angular Providers and Angular ng-templates, match the default widget.If the dependencies match, check whether the user is accessing the portal through a custom portal other than /sp.If a custom portal is in use, validate the cloned widget at both the page level and the widget level using the following procedures. Validate a cloned widget on a custom portal (page level) Use the following steps to determine whether a cloned widget failure is caused by page-level dependencies or the custom widget script. Start from the custom portal URL (for example, /customer_portal?id=customer_page).Create a new portal page and add the custom widget to it (for example, new_page).Check whether the new page loads: If the new page loads: The issue is at the page level. Check the page-specific dependencies on the original page.If the new page still produces an error: Continue to step 4. Change the portal path to the default Service Portal path (for example, /sp?id=new_page).Check whether the page loads on the default portal path: If the page loads: The issue is related to the custom portal configuration.If the page still does not load: The issue is with the custom widget script. Validate at the widget level Use the following steps to determine whether the failure is caused by the custom widget code or a broader configuration issue. Start from the custom portal URL (for example, /customer_portal?id=customer_page).Replace the custom widget with the default widget on the custom page.Check whether the page renders the default widget: If the page renders the default widget: The issue is with the custom widget code.If the page does not render the default widget: Continue to step 4. Create a new page and add the default widget to it.Check whether the new page loads with the default widget: If the new page loads: The issue is related to the custom page configuration.If the new page does not load: Further investigation is required. Check the default Service Portal path If the issue also occurs on /sp in addition to the custom portal, test the widget in $sp.do. If the issue does not occur in $sp.do, the cause is likely a custom dependency in the Dependencies table with Include on Page load set to true. Additional troubleshooting steps If the preceding steps do not resolve the issue, try the following approaches. Isolate the failing widget SNKIT is a third-party Chrome extension for debugging Service Portal widgets. Open SNKIT and identify the widgets on the page. Remove all widgets except the one you are troubleshooting. If the page loads, add widgets back one at a time to identify which widget causes the failure. Debug the server script Add $sp.log statements to the server script to identify which line of the widget is failing. Validate data visibility If data does not display on a field in the portal page, check whether the same data is visible in the platform UI. Also verify the roles assigned at the page and widget level, as role restrictions can affect data visibility. Check view rules For records that do not display correctly, check whether the portal is loading a specific view. Review the URL for view parameters, and check the view rules configuration. Verify widget status Confirm that you are not using a deprecated widget, whether default or customized. Resolve display and CSS issues If widgets overlap, icons do not load, or images display incorrectly, start by checking whether the portal theme has been modified. Review the page and widget HTML to narrow down the issue using the browser inspect tool. Check the attributes loading in the Styles section, and test changes in the HTML to determine whether they resolve the display issue. For CSS-related issues, refer to the Service Portal styles product documentation, which describes the hierarchy of styles applied in Service Portal. Try reverting to default themes to check whether that resolves the issue. Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Defining portal styles How to identify slow widgets on a Service Portal page Six common performance pitfalls in Service Portal and how to avoid them