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.

Dynamic query for field reference in UI page

dgovindhara
Tera Contributor

Hello Team,

 

         we have two reference fields called category and subcategory. Subcategory should set lookup filter based on category selected by user and it is working fine. After setting category, trying to do search by writing in field subacetgory, it is showing all the results irrespective of category.

 

dgovindhara_0-1761898795800.png

could you please help us out to fix the issue?

Thanks in advance

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@dgovindhara 

if both the fields are reference type on UI page then I have shared something similar solution earlier

see that and enhance

Change ui reference query 

💡 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

Using this solution, I am able to see filtered results when i click on magnifier icon of that reference field. but not filtering when i type something on that field

@dgovindhara 

Glad to know that my approach worked for you to filter the records.

that's the OOTB behavior with reference fields in UI page, we can't do anything there.

💡 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