Show different drop down options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 12:48 AM - edited 05-25-2023 01:11 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 01:15 AM
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.
hope this is helpful!