Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to make a field appear when a certain drop down is selected

DeIvory Gordon
Tera Guru

Hello, 

 

I created a catalog item with the following drop down: 

Account Type:
Employee
Contractor/Vendor

 

If Employee is chosen, give a drop down with the following choices for Country:
Mexico
Brazil

 

if Contractor is chosen, alter the Country choices to the below:
United States
Canada
Mexico
Brazil

 

How do I do this using a UI policy and without creating a script?  Please provide simple instructions.  Thank you!

1 ACCEPTED SOLUTION

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @DeIvory Gordon 

 

https://www.servicenow.com/community/developer-forum/display-fields-in-catalog-item-on-selection-of-...

 

You can try Onchange catalog client script to make the variables visible only if the ChoiceB is selected

if (g_form.getValue('Variablename') == 'ChoiceB') {
g_form.setVisible('Variablename1', true);
g_form.setVisible('variabename2', true);

} else {
g_form.setVisible('Variablename1', false);
g_form.setVisible('variabename2', false);
}

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.
 
credits : @Omkar Kumbhar 

 

 

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

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

View solution in original post

1 REPLY 1

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @DeIvory Gordon 

 

https://www.servicenow.com/community/developer-forum/display-fields-in-catalog-item-on-selection-of-...

 

You can try Onchange catalog client script to make the variables visible only if the ChoiceB is selected

if (g_form.getValue('Variablename') == 'ChoiceB') {
g_form.setVisible('Variablename1', true);
g_form.setVisible('variabename2', true);

} else {
g_form.setVisible('Variablename1', false);
g_form.setVisible('variabename2', false);
}

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.
 
credits : @Omkar Kumbhar 

 

 

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

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