Search by 2 records

Shir Sharvit
Tera Contributor

HI,

I have a field of type list which is a reference to the user table
It shows me 2 columns: name, email.
I want to search by the 3 columns
search both by name and by email

 

 

ShirSharvit_0-1711967369267.png

 

 

I would appreciate the help, thanks Shir

 

4 REPLIES 4

Uttkarsh S
Tera Contributor

Hi @Shir Sharvit,

 

Since you haven't given the 3rd column name, let's say you want to show employee number field on the list collector. Do the following to achieve that:

- Go to the list collector field's dictionary attribute [Right-click on the field name > Configure Dictionary]

 

UttkarshS_0-1711968771712.png

 

- In the attributes field, provide the following value:

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;email;employee_number,ref_ac_columns_search=true

 

It would look something like this:

 

UttkarshS_1-1711968858175.png

 

Verify on the record field that you have those fields visible in the list collector field:

UttkarshS_2-1711968963265.png

 

You can use the reference from this documentation.

 

 

Please mark the answer correct/helpful if my answer helps your query

Cheers,

Uttkarsh

 

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Shir Sharvit 

 

You need to add the new attribute in this case. Under Dictionary

 

AGLearnNGrow_0-1711969218291.png

 

 

 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Sandeep Rajput
Tera Patron
Tera Patron

@Shir Sharvit Please right click to configure the dictionary of your reference field, click on the advanced view from the related links and add following attributes in attribute field.

 

Screenshot 2024-04-01 at 4.25.00 PM.png

Screenshot 2024-04-01 at 4.33.13 PM.pngScreenshot 2024-04-01 at 4.34.56 PM.png

 

Here are the attributes.

 

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;email,ref_ac_order_by=name,ref_ac_columns_search=true, ref_ac_display_value=false

 

Hope this helps.

 

swathisarang98
Giga Sage
Giga Sage

Hi @Shir Sharvit,

Please refer the below article,

https://www.servicenow.com/community/developer-forum/auto-complete-caller-attribute/m-p/2144102 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang