Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Lookup utility

Use the Lookup utility in a Virtual Agent topic to return a ServiceNow record query.

Lookup utility properties

PropertyDescription
Node nameThe name that identifies this Lookup utility node in the topic flow.
Variable nameThe variable that stores the record returned by the script. The variable name is automatically created from the Node name property.
TableThe table used for the query.
Filter this table by usingThe query to retrieve the record. Use the condition builder or a script to specify a query condition.
Advanced
Hide this node
Conditionally show this node ifNo-code condition statement or low-code script that specifies a condition for presenting this node in the conversation. The condition must evaluate to true.

Example Lookup utility

Image omitted: LookupExample.png
Lookup utility properties include a node name, the table to query, and conditions to filter the results of the lookup.

Example Lookup script

(function execute(table) {

       var now_GR = new GlideRecord(table);
       gr.addEncodedQuery('active=true');
       gr.setLimit(1);
       gr.query();
       if(gr.next()) {
          return gr;
    }
})(table)

In this example, a table is queried for the first active record. The table to be queried is defined in the Table property found in the lookup utility control. The setLimit() method ensures that only a single record is returned from the database. If a record is found, it is returned. For more information on GlideRecord queries, see Querying tables in script .

Parent Topic:Assistant Designer utilities