Using Natural Language Query

  • Release version: Washingtondc
  • Updated March 27, 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 Using Natural Language Query

    Natural Language Query (NLQ) enables users to query data in ServiceNow tables using everyday language. It simplifies the process by automatically constructing structured queries without requiring knowledge of the condition builder. Users with the itil role can access NLQ on any list within the platform.

    Show full answer Show less

    Key Features

    • Natural Language Interface: Users can enter queries in plain language, and NLQ translates these into structured queries displayed in the condition builder.
    • Refinement of Queries: After initial queries, users can further refine results by entering additional criteria.
    • Smart Suggestions: As users type, NLQ provides suggestions for columns and fields to enhance query accuracy.
    • Additional Tips: A tips button offers guidance on effective querying methods, including sorting, filtering, and date references.

    Key Outcomes

    By leveraging NLQ, ServiceNow customers can efficiently access and manipulate data within their tables, improving data retrieval speed and accuracy. Queries can include specific parameters such as sorting by category or filtering based on ticket status, allowing for customized data insights tailored to user needs.

    With Natural Language Query (NLQ), you can query data in your tables by entering requests in natural, everyday language.

    NLQ overview

    NLQ turns your plain-language requests into structured queries of your data. You don't need to know how to use the condition builder, because NLQ constructs and displays the conditions for you.

    If you have a role such as itil that can view and interact with tables, you can use NLQ by selecting the natural language filter icon.

    NLQ works on any list on the platform. It returns results only from the table or list you query on.

    Find and use the natural language filter

    Selecting the natural language filter icon brings up the NLQ interface.

    NLQ interface in list view.

    Enter your request in the What do you want to see field, then select Ask. NLQ parses your request, then displays the query in the condition builder. The results of the query are displayed in the list.

    With the default configuration of NLQ, you can continue to refine your query by entering another request into the What do you want to see field.
    Figure 1. Using NLQ to build on a previous query
    Using NLQ to append a query to a previous query

    This example image and procedure illustrates how to build a query using NLQ:

    1. On the Incident table in the natural language filter, enter show me active hardware tickets and select the Ask button.
    2. The condition builder displays All > Active = true > Category = Hardware as the query. The filtered results are displayed in the list.
    3. To narrow down the list of results further, enter without assignment group. Notice that as you type, NLQ displays possible matches for columns and fields. Select assignment group from the list of suggestions, and then Ask.
    4. In the condition builder, NLQ adds >Assignment group is empty to the query. The list refreshes to display only the matching rows.
    5. To reset and start a new query, delete everything in the condition builder so that only All remains.

    Useful information

    Keep the following information in mind when using NLQ.
    • Your requests can contain periods and apostrophes, but not wildcard characters such as asterisks or regex.
    • To group by a field or column, that column must be visible in the list view. Use the personalize list icon () to hide or display columns.
    • For information about querying CMDB tables, see Querying the CMDB.

    Tips for improving your queries

    When you select the Tips for improving your queries button, a modal window appears in the user interface. This window offers the following information about terms you can use in your NLQ questions and requests:
    • Sorting or grouping: grouped by; sorted by; A-Z; z-a
    • Dates: today; yesterday; last; this; next day(s); week(s); quarter(s); year(s)
    • Filtering: starts with; ends with; more than; less than; empty; not empty; and; or
    • Other information: my; my team; created by; unassigned
    Query Example
    Sorting or grouping incidents grouped by category
    Dates created last month
    Filtering short description starts with computer
    Other information unassigned tickets
    Single number INC0777