Text search views control format of global search results for tables

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Text search views control format of global search results for tables

    Thetextsearchview for a table in ServiceNow defines how global search results from that table are displayed. Each search result consists of multiple elements, populated from fields included in the table'stextsearch list view. This formatting controls the title, field list, and optional description shown to users in global search results.

    Show full answer Show less

    Key Features

    • Title: The first line in each search result block, linking to the record. It uses the first string field in the textsearch list view that isn't the number field. If no suitable field exists, "No title" is displayed. For example, the Incident table uses the short description field as the title.
    • Field list: The second line displays up to 10 field name-value pairs from the textsearch list view, excluding the title and description fields. For the Incident table, fields like number, opened, caller, priority, state, category, assignment group appear here.
    • Description (optional): The third line shows the first string field over 100 characters in length from the textsearch list view, excluding the title. If none exists, this line is omitted. For Incident, the description field is used.

    Configuration and Behavior

    By default, ServiceNow uses the textsearch list view to format global search results by table. If no such view exists, it falls back to the table’s default form view. Administrators can override which view is used by setting the glide.ui.textsearch.view system property.

    Practical Implications for ServiceNow Customers

    • Understanding how the textsearch view controls search result formatting helps tailor the search experience to users' needs by customizing which fields appear in global search results.
    • Ensuring appropriate fields are included in the textsearch list view allows for clear, informative titles and summaries in search results, improving findability and user efficiency.
    • Using the system property to specify alternative views can enable customized search result displays without modifying the default views.

    Additional Information

    Several tables are pre-enabled for global search with predefined textsearch list views that determine their default display fields. Related configurations include setting global text search properties, adjusting preview limits, and controlling how search result counts appear in the UI.

    The text_search view for a table determines how global search displays results from that table.

    Results displayed by global search include multiple elements. For each search result, the system populates these elements with values of fields included in the table's text_search list view.

    Figure 1. Sample search result listing in Next Experience UI
    Sample search result listing in Next Experience UI showing title, field list, and description.
    Figure 2. Sample search result listing in Core UI
    Sample search result listing in Core UI showing title, field list, and description.
    Table 1. Search result elements
    Element Description Matching criteria
    1. Title The title is the first line of the search result block. It links to the matching record of the search result. Global search uses the first string field in the table's text_search list view that is not the number field. If there is no matching string field or the contents of the field is empty, the system displays the text "No title" in the session language.

    For example, in the default text_search view for the Incident table, the short description field satisfies the title criteria. Global search uses this field as the search result title.

    2. Field list The field list is the second line of the search results. It displays field name-value pairs, separated by the pipe character, for up to 10 fields. Global search uses the first 10 fields in the table's text_search list view that don't match the title or description criteria.

    For example, in the default text_search view for the Incident table, the number, opened, caller, priority, state, category, and assignment group fields satisfy the field list criteria. Global search displays the names and values for these fields in the search result field list.

    3. Description The description is the third line of the search results. This line is optional and may not appear for all search results. Global search uses the first string field in the table's text_search list view that is not the title and is over 100 characters in length. If no field matches these criteria, the search results omit this line.

    For example, in the default text_search view for the Incident table, the description field satisfies the description criteria. Global search uses this field as the search result description.

    By default, the system uses the text_search list view for a table to format global text search results for that table. If a text_search view doesn't exist for the table, the system instead formats search results using the table's default form view. Implementers can specify which view the system uses to format search results by modifying the value of the glide.ui.text_search.view system property.