How to Get search results with contains for Reference field .

Rajat27
Tera Expert

 

 

NOTE :-  When I use " * " in reference field it is populate Results but for Without " * " its not . how can I get Same results without * , Thank you.

 

find_real_file.pngfind_real_file.pngI I I I used following 2 Approach But both are Failed.

Approach 1 ) attribute in reference field
                       ref_auto_completer=AJAXTableCompleter, 
                       ref_ac_columns=name,                  
                       ref_ac_columns_search=true

Approach 2) System Property
     Disable the glide.ui.ref_ac.startswith system property.
     added the property glide.ui.goto_use_contains and set the property value to true.

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

1. Ensure that the system property "glide.ui.ref_ac.startswith" is set to false.

2. Confirm that the reference field has similar dictionary attributes as the following:

ref_ac_columns_search=true, ref_ac_order_by=column_name, ref_ac_columns=column_name1, column_name2, ref_auto_completer=AJAXTableCompleter

3. Create the following user preference:

Name: table_name_being_referenced.autocomplete.contains (i.e. sys_user.autocomplete.contains)

System: checked

User: leave this blank

Type: true | false

Value: true

4. After the user preference has been created log out and back into the instance for it to take effect

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

View solution in original post

7 REPLIES 7

Does this work on Service Portal Catalog item Variable type reference field?

Jeff Jessie
Tera Contributor

Will setting up the user preference have to be set up for every user or is it a global preference that can be applied to everyone that accesses the portal?

Mwatkins
ServiceNow Employee
ServiceNow Employee

ServiceNow does not recommend setting glide.ui.ref_ac.startswith to false. It changes a system wide behavior to be very inefficient. For the love of Fred, teach your end users to use the asterisk when they want to do contains searches and keep startswith as the default behavior. See the following article for an explanation: https://www.servicenow.com/community/developer-articles/performance-hacks-reference-fields-4-of-4-co...

 

Please Correct if this solves your issue and/or 👍 if Helpful

"Simplicity does not precede complexity, but follows it" - Alan Perlis