How to populate List Collector field based on Select box field in Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi All,
In one catalog item, I have two fields:
Role Category → this is a Select box field
Sub Category → this should be a list collector where user can select multiple roles. User wants this to be list collector as they want to select multiple roles
We have more than 200 sub values, so hardcoding in client script is not possible.
My requirement is:
When user selects a Main Category, only related Sub Category values should show in the list collector.
Main is single select, Sub is multi select.
What is the simple and best way to do this?
Can we achieve this using a Reference Qualifier and a mapping table?
Or is there a simpler way without too much client-side scripting?
Any suggestions or examples would be very helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hi @Mahalakshmi Rav ,
Create a mapping table (e.g. u_role_subcategory_map) with columns: Role Category and Sub Role.
>> In your Catalog Item:
Variable A: Role Category (single select / choice or reference)
Variable B: Sub Category (List Collector) referencing your Roles table
On Sub Category variable, set the Reference Qualifier to something like:
javascript:'u_role_category=' + current.variables.role_category
Add the attribute ref_qual_elements=role_category on the List Collector variable so it dynamically updates when Role Category changes....
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/