Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

ServiceNow Quick Tip: Global Autocomplete Settings for Reference fields

Chris Federlin
Tera Contributor

How to Globally Customize ServiceNow User Reference Autocomplete

 

Are you looking for a way to modify the autocomplete results for any reference field that points to the User (sys_user) table?

Perhaps you want to add the user's Email or Department to the type-ahead suggestions to help agents distinguish between users with similar names. You could configure this on the Incident form, but then you have to do it again for the Request form, the Problem form, and so on.

The smarter way to do this is by setting a default behavior globally. By adding a dictionary attribute to the Collection record of the sys_user table, you can force every reference field pointing to that table to inherit your new format.

Here is how to set the ref_ac_columns attribute globally.

 

Step-by-Step Instructions

 

 

1. Navigation

 

Ensure you have Admin privileges. In the Application Navigator (left-hand menu), navigate to: System Definition > Dictionary

 

2. Find the Collection Record

 

Filter the list of dictionary entries to find the correct record. This is the most crucial step. You are not looking for a specific field or column; you are looking for the table definition itself.

Set your list filter to:

  • Table is sys_user

  • Type is Collection

There should only be one matching record, and the 'Column name' field will be empty. Click this record to open it.

 

3. Add the Attributes

 

Scroll down to the Attributes related list. If you don't see it, you may need to switch to the Advanced view (using the link under Related Links) to see the Attributes text field.

In the Attributes field, add the following comma-separated values:

Plaintext
 
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email

Breakdown:

  • ref_auto_completer=AJAXTableCompleter: This ensures the system uses the correct completer class that supports extra columns.

  • ref_ac_columns=email: This tells the system to pull the email column from the database and display it next to the name.

 

4. Save

 

Click Update or Save.


 

How It Works & What to Expect

 

 

Before the Change

 

When you type in a reference field like 'Caller', you only see the Display Value (typically the user's full name).

Beth Anglin Abel Tuter

 

After the Change

 

After saving the attributes, the system will display both the name and the email address in the autocomplete dropdown.

Beth Anglin | beth.anglin@example.com 

Abel Tuter | abel.tuter@example.com

This change is now reflected on every reference field pointing to the sys_user table across the platform, including:

  • Caller on Incidents (incident.caller_id)

  • Assigned to on Tasks (task.assigned_to)

  • Requested for on Catalog Items (sc_request.requested_for)

  • Any custom reference fields you have created.


 

Important Considerations

 

 

1. Searching by the New Column

 

By default, adding the column only displays it. If you want users to be able to type an email address to find the user, you must add one more attribute: ref_ac_columns_search=true

 

2. Multiple Columns

 

You can add more than one column by separating them with a semicolon (;). Example: ref_ac_columns=email;department;location

 

3. Performance

 

Be cautious. Adding too many columns—or columns that require complex database joins—can impact the performance of the lookup. Stick to simple fields on the sys_user table itself (like Email, Department, or Location) for the best results.

 

4. Local Overrides

 

If a specific reference field (e.g., incident.caller_id) has its own ref_ac_columns attribute defined on its specific dictionary entry, that local attribute will override the global one you just set. This is great for handling exceptions where you need a different view.

 

5. Caching

 

It may take a few moments for the change to be visible everywhere as the system caches schema information. If you don't see the change immediately, type cache.do in the filter navigator and press Enter to clear your instance cache.

0 REPLIES 0