Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Page with a UI Reference field that searches multiple fields and shows specific columns

Suvitha Murugan
Tera Contributor

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?

  <g:ui_reference name="user" id="user" table="XXXresp" query="${qual}" completer="AJAXTableCompleter" attributes="ac_columns=user;user.email;user.user_name,ac_columns_search=true,ac_search_fields=user.last_name,ac_display_value=false" columns="user;user.email;user.user_name" />



SuvithaMurugan_0-1765188293977.png

 

Thanks in Advance

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Suvitha Murugan 

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

AnkurBawiskar_0-1765190105969.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader