How to use Category and Subcategory variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2020 08:41 AM
Hi All,
I have a catalog form where I have two select box variable called Category and Subcategory. Category and Subcategory has various choice. My requirement is when a choice is selected in Category only a specific set of choice should be available for Subcategory. Example below.
Category has three options
Subcategory has following options
But when Audio issue is selected under Category only following options should be available under subcategory
Other category and subcategory as below
Catalog Form
Any help is highly appreciated. Thanks in advance!
Regards,
Jitendra Singh
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2020 08:48 AM
Hello Jitendra,
Please refer https://www.concurrency.com/blog/september-2019/servicenow-dependent-variables-on-record-producer-in...
- Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2020 06:12 AM
Let me know if that answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list
- Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2020 08:50 AM

-
Write a script include function that takes a parameter (which will be the first variable's value) to query the reference table of the second variable, and return a stringified encoded query based on that query.
-
We need to tell the system that the first variable has a dependency on it. To do this, in the "Default Value" tab (at least this is usually where it is), we need to add the following to the "Variable attributes" field:
-
For the second variable, we also need to tell the system that this variable is dependent on the first. Following the same navigation as the previous step, add the following to the "Variable attributes" field:
-
Finally, in the "Type Specifications" tab (again, this is usually where this field is), we need to add the following to the "Reference qual" field:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2024 08:36 AM
Thank you so much for this it worked great with one exception for my case. I am trying to use this from a unauthenticated record producer. When I try to use this the sub category comes up empty. Any thoughts on how I can get public access to the sys_choice or what ever is needed to work?