Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

scripting

WeighedBrass95
Kilo Contributor

How do I configure dependent choices from the form? I need to add two and remove one option. It is for the category "Software", and I need code to add two and remove one choice. Also, where/how do I execute the code? Thanks!

1 ACCEPTED SOLUTION

Maham Tahir
Mega Guru

Hi @WeighedBrass95,

 

The message "Configure dependent choices from the actual form" appears because ServiceNow requires you to define choices for a dependent field in the context of its parent. Since the available "Subcategory" options change depending on the selected "Category," you cannot set a single list of choices in the dictionary.

 

To configure the choices, you must go to the form where these fields are used and follow these steps:

  1. Navigate to the form 

  2. Select a value in the "Category" field 

  3. Right-click the "Subcategory" field label and select "Configure Choices".

  4. A new screen will appear where you can add, remove, or reorder the choices that should be available only when "Software" is the selected category.

  5. Save your changes.

  6. You will need to repeat this process for every value in the "Category" field to define their respective subcategory options.

If you find my response helpful, mark it as helpful and accepted solution.

 

Regards, 

Maham Tahir.

View solution in original post

3 REPLIES 3

Dr Atul G- LNG
Tera Patron

Hi @WeighedBrass95 

First, you need to create all the values in the category list. Then, if you want to control visibility, you can set the appropriate restrictions.

 

https://www.servicenow.com/community/incident-management-forum/hide-subcategory-option-based-on-cate...

*************************************************************************************************************
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/dratulgrover [ Connect for 1-1 Session]

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

Maham Tahir
Mega Guru

Hi @WeighedBrass95,

 

The message "Configure dependent choices from the actual form" appears because ServiceNow requires you to define choices for a dependent field in the context of its parent. Since the available "Subcategory" options change depending on the selected "Category," you cannot set a single list of choices in the dictionary.

 

To configure the choices, you must go to the form where these fields are used and follow these steps:

  1. Navigate to the form 

  2. Select a value in the "Category" field 

  3. Right-click the "Subcategory" field label and select "Configure Choices".

  4. A new screen will appear where you can add, remove, or reorder the choices that should be available only when "Software" is the selected category.

  5. Save your changes.

  6. You will need to repeat this process for every value in the "Category" field to define their respective subcategory options.

If you find my response helpful, mark it as helpful and accepted solution.

 

Regards, 

Maham Tahir.

Tanushree Maiti
Kilo Patron

Hi @WeighedBrass95 ,

For 2 Addition:

  1. Right-click the Subcategory label and choose Configure Dictionary.
  2. Go to the Choices related list at the bottom.
  3. Click the choice you want to change, set Dependent value to Software. 

For Removal,

 on above step2 : open choice list ,

                             1.  open the choice which is not required and Dependent value to Software 

                             2. Deactivate it.

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: