Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Service Portal - Typeahead search throwing errors with languages other than english - Cannot convert null to an object. Failing widget - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Service Portal - Typeahead search throwing errors with languages other than english - Cannot convert null to an object. Failing widget
KB0719309

Service Portal - Typeahead search throwing errors with languages other than english - Cannot convert null to an object. Failing widget


3912 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Issue


- Switch the system language to non-english eg: German

- Go to Service Portal and search for any keyword in the Typeahead Search Widget

eg: https://instancename.service-now.com/sp?id=search&q=mobile

Errors:

Server JavaScript error Cannot convert null to an object.
Line number 94
Script source code logged to browser console
Failing widget: 'Typeahead Search' (fa20ec02cb31020000f8d856634c9ce9)

(or)

Server JavaScript error Cannot convert null to an object.
Line number 69
Script source code logged to browser console
Failing widget: 'Search Page' (b8c57073cb10020000f8d856634c9cfc)

 

Symptoms


Check the system logs if there are errors as below:

org.mozilla.javascript.EcmaError: Cannot convert null to an object.
Caused by error in <refname> at line 46

43: while(m2mSearchSourceGR.next()) {
44: var searchSourceGR = m2mSearchSourceGR.getElement("sp_search_source").getRefRecord();
45: data.resultTemplates["sp-search-source-" + searchSourceGR.getValue("id") + ".html"] = $sp.translateTemplate(searchSourceGR.getValue("search_page_template"));
==> 46: getResults(searchSourceGR);
47: }
48: }
49:

java.lang.NullPointerException
Caused by error in sp_search_source.c96eb1686721220023c82e08f585efff.data_fetch_script at line 16
com.glide.catalog.cache.impl.DefaultTranslationProvider.getFieldTranslationsFromSysTranslated(DefaultTranslationProvider.java:231)
com.glide.catalog.cache.impl.DefaultTranslationProvider.access$300(DefaultTranslationProvider.java:29)
com.glide.catalog.cache.impl.DefaultTranslationProvider$FieldTranslationProvider.getTranslations(DefaultTranslationProvider.java:424)
com.glide.catalog.cache.impl.DefaultTranslations.getFieldTranslation(DefaultTranslations.java:80)
com.glide.catalog.cache.impl.ServiceCatalogI18NCacheableItemAdapter.resolveFieldValue(ServiceCatalogI18NCacheableItemAdapter.java:79)
com.glideapp.servicecatalog.Category.getTitle(Category.java:491)
com.glideapp.servicecatalog.Category.get(Category.java:137)
com.glideapp.servicecatalog.CatalogItem.getFirstAccessibleCategoryForSearch(CatalogItem.java:633)
com.glideapp.servicecatalog.scoped.api.CatalogItemJS.jsFunction_getFirstAccessibleCategoryForSearch(CatalogItemJS.java:316)
sun.reflect.GeneratedMethodAccessor1567.invoke(Unknown Source)

 

Enable debugging and check the debug logs:

[DefaultTranslationProvider] Loading translations for: table=sc_category, id=d258b953c611227a0146101fb1be7c31, language=en, source=sc_category
SQL04:17:34.776: Time: 0:00:00.000 for: caveriondev_2[glide.17] SELECT ... FROM (sc_category sc_category0 INNER JOIN sys_metadata sys_metadata0 ON sc_category0.`sys_id` = sys_metadata0.`sys_id` ) WHERE sc_category0.`sys_id` = 'd258b953c611227a0146101fb1be7c31' /*...*/ 
log04:17:34.778: [DefaultTranslationProvider] No db entry for: table=sc_category, id=d258b953c611227a0146101fb1be7c31, language=en, source=sc_category
log04:17:34.779: Evaluator: java.lang.NullPointerException Caused by error in sp_search_source.c96eb1686721220023c82e08f585efff.data_fetch_script at line 16 com.glide.catalog.cache.impl.DefaultTranslationProvider.getFieldTranslationsFromSysTranslated(DefaultTranslationProvider.java:231)

 

Cause and Solution


The issue is caused due to Catalog items pointing to Null Category.

Open "sc_cat_item" table and group by on field "Category"

If you see any catalog items with category as sys_id instead of a name, open it and check the value of the category. If it is pointing to Null, they are the ones causing the issue.

https://instancename.service-now.com/nav_to.do?uri=%2Fsc_cat_item_list.do%3Fsysparm_query%3Dcategory.titleISEMPTY%255Ecategory!%253DNULL%255EGROUPBYcategory%26sysparm_first_row%3D1%26sysparm_view%3D

Check the attached screenshots for reference.

To resolve the issue, make sure that there are no catalog items pointing to NULL category.

 


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

Attachments

Attachments

No attachments found

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.