
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 04:36 PM
I am trying to create a record producer for the dmn_demand table. The field 'type' is dependent on 'category' and through a number of iterations of trying to mimic what people have done on incident record producers with category/subcategory I have this:
and this:
But it is not working at all. No variables are returned on the form for either field.
What am I doing wrong?
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 05:48 PM
Hello,
Sorry, I'm a bit confused. So your type variable is dependent on the category and you're showing that no categories are even showing up? So at this point, we can't even address the whole type being dependent on it since you don't even have any categories showing up.
Please check your reference qualifier and and variable settings for the category field first and foremost. Then ensure you have appropriate "read" privledge to the data. Not sure who you're viewing this as, as admin, another user, etc?
Once that is all setup properly (could even test removing the reference qualifier altogether on the category field just to make sure it's even working...), then you can move to the type field. That seems to be correctly setup with the ref qual and then the attribute as needed.
The reference qualifier for category field seems right with:
element=category^name=dmn_demand
Out of box, there is only two that would show, just fyi.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 05:48 PM
Hello,
Sorry, I'm a bit confused. So your type variable is dependent on the category and you're showing that no categories are even showing up? So at this point, we can't even address the whole type being dependent on it since you don't even have any categories showing up.
Please check your reference qualifier and and variable settings for the category field first and foremost. Then ensure you have appropriate "read" privledge to the data. Not sure who you're viewing this as, as admin, another user, etc?
Once that is all setup properly (could even test removing the reference qualifier altogether on the category field just to make sure it's even working...), then you can move to the type field. That seems to be correctly setup with the ref qual and then the attribute as needed.
The reference qualifier for category field seems right with:
element=category^name=dmn_demand
Out of box, there is only two that would show, just fyi.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2021 07:00 AM
I'm viewing as Admin, currently and I have confirmed the 2 categories exist on the sys_choice table, as well as the 4 dependent types, so that all looks correct on the table. If I take the reference qualifier off of the category field, I get a giant list of garbage like this
But interestingly, for kicks, I decided to put in the reference qualifier as you had it in your reply (element then name), which was backwards from the way I originally wrote it (name then element) and it worked. I added a qualifier for language and here's the result:
Left my reference qualifier for type written as it was, but also added the language qualifier and now it works!
javascript:"name=dmn_demand^element=type^language=en^dependent_value=" + current.variables.category;
Not to look a gift horse in the mouth, and all that, but I currently have 5 tabs open with information about how to do this and literally all of them had the reference qualifier for the first field written with the name, then the element. Do you have any idea why the order would make such a difference?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2021 08:34 AM
Hi,
I'm not sure, it could have been when it was pasted in there or typed previously, somehow there was some hidden character. ServiceNow sometimes does wonky things like that.
You can try doing it again your way and see if it works and if it was literally due to swapping them around. Generally, it shouldn't matter.
I went to list view for sys_choice, filtered as necessary, then right-clicked the last piece of the blue breadcrumb trail and select "copy query".
Is that how you build your encoded queries as well?
If not, I'd highly recommend it as it's much easier.
But...you shouldn't HAVE to do that, just saying.
Let me know if any of my replies helped guide you Correctly, if so, please also mark as Correct.
Thanks! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2021 09:08 AM
Awesome! I learned something new--I didn't know I could build encoded queries that way, I was just copying what someone else did. And yes, there must have been some weird character in my original one because I swapped them back and it still works fine.
Thanks so much for your help!