How do I change the type ahead search from "starts with" to contains?

Nic Omaha
Tera Guru

I have a variable that will automatically do a query for starts with when entering in text. I can enter *"text" and it will do a contains search. How do I make this the default search?

search.png

7 REPLIES 7

matthew_magee1
Giga Guru

Nicholas,



Mark's response is correct. What you need to do is two fold. Part 1:



  1. Open the link he provided: Auto-Complete for Reference Fields - ServiceNow Wiki
  2. Scroll down to the very bottom: Contains Auto Complete Search and follow the instructions to update the User Preferences table


Part 2:


Also, you'll want to check the security rules for the table you are doing a look up on. I was able to use the reference field as an Admin. But when i impersonated a regular user, I wasn't able to see the values? Why you ask? Because the 'read' security rule for the table i was referencing had a role associated with it. Not good.



In my frustration, I mean example, I created a new table which pulls in data from another data source. It has over 3500 records. I wanted the user to be able to go to the reference field and begin typing any value and the reference field would auto-magically list all references w/ the string they typed.



Our of frustration, I stumbled across the auto-complete wiki page above and tried the steps in the last section. I created a new record in the user preferences table and whola, it worked. But as stated, I had to adjust the 'read' security rule for my new created table.



Good luck!


MGanon
Tera Guru

https://docs.servicenow.com/administer/field_administration/task/t_ContainsAutoCompleteSearch.html

https://docs.servicenow.com/administer/field_administration/concept/c_AutoCompleteForReferenceFields.html

MGanon
Tera Guru

The https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/field-administration/concept/c_AutoCompleteForReferenceFields.html#t_ContainsAutoCompleteSearch document seems to discourage using a CONTAINS auto-correct query. It appears that, since around Helsinki, ServiceNow sets the system to the STARTSWITH query for reference fields with the glide.ui.ref_ac.startswith system property then requiring a user preference for each reference field of each table. Am I reading this correctly?