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

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.

Does ref_ac_search_fields actually exist and do anything? I cannot find any reference to it in the actual documentation and very little any where else in the community. I may specifically test this later today when I have more time...

 

I'm wondering because it may be that my original assumption is correct in that user.user_name contains first and last so your solution may appear to solve the issue but isn't actually providing the functionality that has been explicitly requested.

@Anupam1 

could you share screenshots supporting your solution?

I don't think the original question has any solution.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

To my knowledge there isn't a way to do what you are seeking. When I made my comment I assumed that user.user_name was the full name First and Last so a search would still capture Last Name.

The functionality of this is really built on the assumption that if you are searching within a specific field then you are going to want to see the values for that field in the results otherwise the user experience becomes confusing as there is no displayed indicator of why a specific record was returned in response to the user's search.

Ankur Bawiskar
Tera Patron
Tera Patron

@Suvitha Murugan 

what you are looking for is not achievable.

whatever columns you add in ref_ac_columns that will show and system will allow user to search on them as well.

You can be selective here.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader