UI Page with a UI Reference field that searches multiple fields and shows specific columns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I need the search to work on the Name, Last Name, and Email fields. Currently, it only searches the Name field. The user should be able to find a record by any of these fields. Also, during the search, only two names are shown—how can I display specific fields that I want in the search results?
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Not directly possible within UI page
but here is a possible workaround
-> the fields you want to allow searching should have ref_ac_columns and ref_ac_columns_search added in attributes in dictionary
-> then only UI page will allow user searching on it
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You can’t make a single <g:ui_reference> on a UI Page search more than the default display field.....even if you supply attributes like ref_ac_columns and ref_ac_columns_search=true, because the built in UI Page auto completer does not honor those extended attributes.......If you really want search on name, last name, email and show multiple columns, the working solution is to create a real reference field in the dictionary pointing to your target table, add dictionary attributes ref_auto_completer=AJAXTableCompleter, ref_ac_columns=name;last_name;email, ref_ac_columns_search=true, then use that field via <g:ui_reference> only then will autocomplete search across the added columns and show them in the drop down......
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Technical Consultant - ServiceNow Class of Legends 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
It seems the same approach was shared earlier, about four hours ago. To avoid any confusion, I suggest we refrain from repeating the same information.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader