How would I change or add to default search field for a referenced field?

Ken45
Kilo Explorer

How would I change or add to default search field for a referenced field?

For example...
On any form that references the cmdb_ci table, how would I set the default search/auto-complete to use a field other than "Name?"  I'd like the search feature to reference multiple fields so users could search by model #, serial #, etc. to find a ci.

Thanks in advance!

2 REPLIES 2

Tim Deniston
Mega Sage
Mega Sage

Dictionary Attributes facilitate this. 

https://docs.servicenow.com/bundle/kingston-platform-administration/page/administer/field-administra...

 

Typically, you would use several, like this:

 

ref_auto_completer=AJAXTableCompleter (This displays results with the additional columns in ref_ac_columns)

ref_ac_columns=model_id;serial_number;asset_tag;manufacturer (This defines the fields that are displayed in addition to the display value)

ref_ac_columns_search=true (This defines that the additional fields in ref_ac_columns are included in the search)

 

Putting it all together, do this:

  1. Right-click your reference field's label and select Configure Dictionary.
  2. Locate the Attributes field. If you don't see it, click Advanced View in the Related Links.
  3. Enter the following into the Attributes field:
    1. ref_auto_completer=AJAXTableCompleter,ref_ac_columns_search=true,ref_ac_columns=email;employee_number

Different attributes must be separated by comma (,) and fields within ref_ac_columns must be separated by semi-colon (;). 

If you want any reference to a table, such as sys_user, to have the same reference lookup settings, go to the table's Collection record in the system dictionary and set the attributes there.

Hi there.

Thanks!  What if I I have a dictionary override set up?  I have a script include to filter downstream CIs based on business services.  And it turns out the column I’m trying to reference is an extension of the CI table.  Do you know if there is a way to work around these configurations or is it one or the other?  And while I can make this work after turning off the override, it doesn't seem to carry over to the service portal.

Again, thanks!