Making custom tables searchable in ServiceNow
Problem
You've created a custom table but when you use global search or search in configurable workspaces, the table's records are never returned.
The name of the search on the top
The search on the top is called the Next Experience Unified Navigation search field.
Using AI Search in Next Experience
Using AI Search in Next Experience (opens in a new tab)
Setting Show global search on the experience settings
If you open UIB and navigate to an experience overview, there will be a button in top right to access the Experience Settings.
Click this button to open the settings and scroll down to the bottom to find the Show global search setting.
If you check this box, there will be an option in the global search box to saerch within that experience. If you uncheck it, this options will not be available (but typically Global will still be available).
Setting text_index
You need to tell ServiceNow you want it to create a search index for the table. You can do this by setting the text_index field on the table's sys_dictionary record to true.
-
Navigate to the
sys_dictionarytable -
Search for your target table with the column
typeset toCollection -
Click on the record for your target table
-
Set the
text_indexfield totrueNote: Thetext_indexfield wasn't visible by default for me, and I couldn't immediately figure out which UI Policy was hiding it. So I ended up updating the value by script like so:var table = new GlideRecord('sys_dictionary'); table.addQuery('name', 'my_table'); table.addQuery('type', 'Collection'); table.query(); table.next(); table.text_index = true; table.update();