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

Filter the search result in reference field

thisisauniqueus
Giga Expert

Hi

Is it possible to filter the search result in a reference field, say for example if a project field is referenced in a table like

find_real_file.png

can i filter the results when i click on the search icon as shown in the screen shot above?

Regards

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi John,



Yes, you can do that quite easily! Reference fields can use what's called   "Reference qualifier" to filter records on the table they reference. By default, you get all the records. If you want to filter them, you can do that quite easily using a reference qualifier. They range from simple (no scripting required) to more advanced (scripted.)



Go to the dictionary entry for that field and note the "Reference specification" section.



Here's an example of a reference qualifier on a table to simply take the Active records of the User table.



find_real_file.png



Reference: Reference Qualifiers - ServiceNow Wiki


View solution in original post

14 REPLIES 14

Added screenshots. Make sure you replace URL with yourinstance name.


Screen Shot 2016-07-24 at 2.08.52 PM.png


Thanks for the update John.


Unfortunately you can only have static popup view for a reference field. You can however define additional columns in drop down if required.



Please raise enhancement request if you would like to get your idea in to eyes of our product team…


Enhancement requests: Tell us how you would improve the ServiceNow product


Thanks alot Pradeep for taking your time




Best Regards


You are very welcome John. Happy to help you


Hi @Chuck Tomasi ,

I've found an issue with the filter builder for a list not respecting the reference qualifier setup in the dictionary.

(e.g.)

  1. A lookup table has a type field, with the refQuals setup on referring tables as:
              javascript:"type="+current.getTableName()"
  2. This works fine when choosing reference values on records in those tables.
  3. However, in the list filter builder for a referring table it is still showing all values from the lookup.

Any thoughts, ideas, or suggestions?  I tried a before query BR on the lookup table as an approach, but it doesn't seem to have access to the parent record to use in determining the correct type to update the query.

 

Thanks,

-Brian