Keyword Based Search In Reference Variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Dear Community,
I am looking for some help regarding a Catalog Item. We have a Reference Variable that points to Software Models. When users search for software models from the catalog, the reference lookup is not performing a keyword-based search. Instead, it only returns records where the value starts with the entered text.
ref_auto_completer=AJAXTableCompleter,
ref_ac_columns=display_name,
ref_ac_columns_search=true
Has anyone encountered this issue before or knows if there are additional configurations, system properties, or settings required to enable true keyword-based searching for reference variables in ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
It sounds like you want to do a 'contains' query. See the section entitled "Improve auto-complete queries" and the ones following it.
https://www.servicenow.com/docs/r/platform-administration/c_AutoCompleteForReferenceFields.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @priyanshp4 ,
I was able to reproduce this issue and successfully test contains-based autocomplete for a Software Models reference variable in a ServiceNow Catalog Item.
I created a demo Catalog Item named Software Model Search Demo with the following configuration:
Reference variable
Type: Reference
Reference table: cmdb_software_product_model
Variable attributes:ref_auto_completer=AJAXTableCompleter,ref_ac_columns=display_name,ref_ac_columns_search=true
System property
glide.ui.ref_ac.startswith = false
User preference
cmdb_software_product_model.autocomplete.contains = true
Search for Acrobat
The autocomplete returned:
Adobe Systems Acrobat DC Professional
Adobe Systems Acrobat DC Standard
Search for robat
The autocomplete returned the same two records, even though the search term occurs within the word Acrobat.
https://www.servicenow.com/docs/r/platform-administration/c_AutoCompleteForReferenceFields.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
So in other words, you followed the link I posted hours earlier, then posted the same link?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @priyanshp4 ,
Yes, By default, reference field and variable lookups use a starts-with search. To get a contains (keyword-based) search, you need to enable it using below steps :
- Set the system property glide.ui.ref_ac.startswith to false.
- Navigate to User Administration > User Preferences
- Name: <referenced table name>.autocomplete.contains.
- Type: string
- Value: true
- System: checked
Refer Below :
On a Catalog Form, there is a Reference variable. But it gives poor search accuracy. What to do?
How to configure a "contains" search for a table
If my response helped mark as helpful and accept the solution.