The CreatorCon Call for Content is officially open! Get started here.

Is there a way to specify the columns to seach in a Reference Field?

Jose Agudelo
Tera Contributor

I am looking for a way to specify the columns with which the search will be performed in the Caller ID field of the incidents form. That is, I can see the name, mail, email, phone, but the autocomplete search should only be performed by the name or the phone, excluding the other fields.

 

Is there a way to perform this?

4 REPLIES 4

vignesh parthib
Tera Guru

Hi @Jose Agudelo 

 

  • Edit the Caller ID Field
    Go to the caller_id Dictionary entry (on incident)
  • Set the Attributes field to: Display value and allow search 
ref_ac_columns=email;mobile_phone
  • Display value and  block search
ref_ac_columns=email;mobile_phone
ref_ac_display_value=true​

vigneshparthib_0-1760564813529.png

 

vigneshparthib_1-1760564944030.png

Thanks,
Vignesh
"If this solution resolves your issue, kindly mark it as correct."

Deepak Shaerma
Kilo Sage
Kilo Sage

Hi @Jose Agudelo 

DeepakShaerma_0-1760591038566.png

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;first_name;last_name;user_name;email,ref_ac_columns_search=true

Modify this according to your requirement.

Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help us a lot.
Thanks & Regards 
Deepak Sharma

Ankur Bawiskar
Tera Patron
Tera Patron

@Jose Agudelo 

whatever fields you add in ref_ac_columns attribute in field those will be shown when user types in

The search happens with all of them -> You can't restrict search based on particular field

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email;mobile_phone,ref_ac_columns_search=true,ref_ac_order_by=name

💡 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

kaushal_snow
Mega Sage

@Jose Agudelo ,

 

You can absolutely control what columns are searched (and shown) in the Incident > Caller ID field by adding dictionary attributes such as ref_auto_completer=AJAXTableCompleter, ref_ac_columns=name;phone (or whatever fields you want), and ref_ac_columns_search=true, which instructs ServiceNow to only autocomplete using those specified columns rather than all displayed fields, and just be careful: including too many columns can slow down the autocomplete if they’re not backed by indexes.......

 

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.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/