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.

Filter reference field based on another reference field in catalog item

Bindhu1
Tera Contributor

Hi , Kindly help me to achieve this .

Bindhu1_0-1707917078016.png

I have two reference field ,
1st field refers to u_building (which stores locations) and
2nd field refers to  u_cmdb_ci_server_virtual (stores VMs)
Based on location selected is first variable , 2nd variable should give VMs of that location 

Sample record of u_cmdb_ci_server_virtual (stores VMs)  with location refers to u_building (which stores locations)

Bindhu1_1-1707917549141.png

 



 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@Bindhu1 You should use the following reference qualifier on the second variable.Screenshot 2024-02-14 at 7.15.38 PM.png 

 

javascript&colon;'location='+current.variables.<first_variable_name>

 

Here replace <first_variable_name> with name of the first variable.

 

Hope this helps.

 

View solution in original post

4 REPLIES 4

Sandeep Rajput
Tera Patron
Tera Patron

@Bindhu1 You should use the following reference qualifier on the second variable.Screenshot 2024-02-14 at 7.15.38 PM.png 

 

javascript&colon;'location='+current.variables.<first_variable_name>

 

Here replace <first_variable_name> with name of the first variable.

 

Hope this helps.

 

Thanks for replying , this filter giving all record, not sure where i am going wrong .tried with different filter

javascript&colon;'location='+current.variables.select_the_data_centre
javascript&colon;'location='+current.variables.select_the_data_centre.u_building_name

 

Hi @Sandeep Rajput , Thanks for your help. 
This is working with below filter

javascript&colon;"location="+current.variables.select_the_data_centre

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Bindhu1 

 

Dud you try with depend way like we have category and sub category?

*************************************************************************************************************
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]

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