Attribute ref_ac_display_value=false is not working for Dictionary

Suvitha Murugan
Tera Contributor

Hi 

I’ve added multiple columns for searching, but I need to hide a specific column from the autocomplete display. The attribute ref_ac_display_value=false doesn’t seem to work at the dictionary level. Can someone help? I specifically want to hide the last name.


ref_auto_completer=AJAXTableCompleter,ref_ac_columns=user;user.last_name;user.email;user.user_name ,ref_ac_columns_search=true,ref_ac_display_value=false

SuvithaMurugan_0-1764943587061.png

Thanks in Advance

1 ACCEPTED SOLUTION

Hi @Suvitha Murugan ,

 

So you are aiming for a setup where user.last_name remains searchable but is not shown in the autocomplete dropdown. Unfortunately, ServiceNow's autocomplete behavior is tightly coupled to the ref_ac_columns attribute, and there’s no built-in way to selectively hide a column from display while keeping it searchable if it's listed in ref_ac_columns.

 

Recommended Configuration

ref_auto_completer=AJAXTableCompleter

ref_ac_columns=user;user.email;user.user_name

ref_ac_columns_search=true

ref_ac_search_fields=user.last_name

  • ref_ac_columns: Controls what is shown in the dropdown. Exclude user.last_name here.
  • ref_ac_search_fields: Allows searching by user.last_name even though it’s not displayed.
  • ref_ac_columns_search=true: Enables multi-column search across the listed fields.

 

 Why ref_ac_display_value=false Doesn’t Help

That attribute only hides the default display value (usually the name field), not individual columns. It doesn’t affect visibility of fields listed in ref_ac_columns.

 

Alternative (if you must keep user.last_name in ref_ac_columns)

If you're using a custom UI or GlideAjax logic, you could:

  • Post-process the autocomplete results to strip out last_name before rendering.
  • Use a custom formatter or UI policy to mask the column visually (e.g., CSS or DOM manipulation).

But these are workarounds and not supported natively in platform configuration.

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Best,

Anupam.

View solution in original post

9 REPLIES 9

sarah_bioni
ServiceNow Employee
ServiceNow Employee

Hi @Suvitha Murugan ,

 

Did you try to remove the user.last_name from the ref_ac_columns? 

 

Regards,

Sarah Bioni

@sarah_bioni 
Users should have the flexibility to search using their last name.

John Gilmore
Giga Guru

Remove user.last_name from 'ref_ac_columns=user;user.last_name;user.email;user.user_name'

the ref_ac_columns=xxx;xxx;xxx determines which columns/attributes of the user record are displayed.

@John Gilmore 
Thanks for the response
Users should have the flexibility to search using their last name. I want to hide display value of the last name during search. Is there any possible way to hide it. Without removing from attribute search.