Search on Two Columns with Reference Field Variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 04:15 PM
I have a custom table that is called in two reference field variables. One of the variables need to search on column A from the table, and the other on column B. I've seen some discussion on this, but none of them seem to have a solid solution that isn't too invasive to the table. Since you can only set one display value to true, I can't get this to work. Any thoughts?
Thanks,
Chris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 04:19 PM
Hi Chris,
You are correct. You can only set one display value to true.
The only option here is that you can define other columns in the search drop down with the help of attribute. More info here.
Auto-Complete for Reference Fields - ServiceNow Wiki
Please let me know if you have any questions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 04:47 PM
You can search on different columns by setting "ref_ac_columns_search" attribute to true. The following example I can search on email field of the user by suing this in the attributes field
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_columns_search=true
Go thru section 8 in this link
Auto-Complete for Reference Fields - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 07:05 AM
Yeah, I saw that earlier, but didn't have much luck. Let me give it another try. where it says email in your example above, if it's two columns, you separate them by commas as well, correct?
So, like:
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,phone,last_name,ref_ac_columns_search=true

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 07:07 AM
Nope, you separate them semicolon.Try this
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email;phone;last_name,ref_ac_columns_search=true