Show different drop down options

Community Alums
Not applicable

Hi,

I have a tricky scenario. I have 3 drop down variables. Based on first and second variable drop down option values, I need to show the drop down option values of the third variable. Can you please let me know what would be the best way to do it.

I had one thought in my mind, I create multiple versions of the third variable and display accordingly using UI Policy.

If you have a better solution, please let me know. Kindly help.
Regards

Suman P.

1 REPLY 1

JT07
Tera Expert

Hi Suman, 

 

Based on your input, I think you can use g_form.addOption() in onchange client script and this will help you to add options dynamically. 

Make sure to use ClearOptions or the removeOption() method when you want to remove the options.

Please go through ServiceNow article, which have listed some points while using addOption method. 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0755115

 

Also there is very nice article available in community to create dynamic options in select box. Please go through this.

https://www.servicenow.com/community/developer-articles/dynamically-create-options-in-a-select-box-b...

 

hope this is helpful!