The CreatorCon Call for Content is officially open! Get started here.

How to populate List Collector field based on Select box field in Catalog Item

Mahalakshmi Rav
Tera Contributor

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.

9 REPLIES 9

nityabans27
Giga Guru

Hi @Mahalakshmi Rav ,

Yes, you can achieve this using a mapping table and a reference qualifier. Create a table that maps Role Category → Sub Category. Configure the Sub Category list collector with an Advanced reference qualifier that filters values from this mapping table based on the selected Role Category. Add a small onChange client script on Role Category to refresh the Sub Category list collector. This avoids hardcoding, keeps it scalable, and requires minimal scripting.

If you find my answer useful, accept it as solution and mark it helpful.

kaushal_snow
Mega Sage

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.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/

Hi @kaushal_snow , Thank you for your suggestion, I tried this approach with the reference qualifier and ref_qual_elements but it didn’t work for me. The Sub Category (List Collector) is still not filtering based on the selected Role Category

Hi @Mahalakshmi Rav ,

 

If the ref_qual_elements approach didn’t work, try setting an Advanced Reference Qualifier on the Sub Category list collector with a script like if (current.variables.role_category) answer='u_role_category='+current.variables.role_category;, and then add an onChange Catalog Client Script on Role Category with g_form.refreshReference('sub_category'); so that the list collector reloads dynamically, making sure your mapping table column names (e.g., u_role_category, u_sub_role) are correct..Try it once...

 

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.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/

Siddhesh Jadhav
Kilo Sage
Kilo Sage

Hi @Mahalakshmi Rav,

 

You don’t need a Script Include for this requirement. I replicated your use case, and it can be achieved simply with a Reference Qualifier on the Sub Category list collector.

 

Set the Reference Qualifier as:

javascript:'u_role.u_name=' + current.variables.select_category

 

Since on the Sub Category table the Role is a referenced field, we just need to dot-walk (e.g., u_role.u_name) so that it matches the selected Role Category.

 

On catalog items, you can access variables using:

current.variables.<variable_name>

 

Additionally, add an onChange Catalog Client Script on the Role Category variable to clear previously selected Sub Categories whenever the main category changes. This ensures users only select valid values.

 

I have also attached screenshots for your reference showing the setup and results.

 

With this approach, no Script Include is needed to fetch data — the filtering works directly via the qualifier.

 

Thanks & Regards,
Siddhesh Jadhav
ServiceNow Rising Star 2025

 

I hope this helps resolve your query. If yes, please mark my answer as Accepted and Helpful.

 

screencapture-dev277205-service-now-sp-2025-09-22-23_29_33.pngscreencapture-dev277205-service-now-sp-2025-09-22-23_10_17.pngscreencapture-dev277205-service-now-sp-2025-09-22-23_09_50.pngscreencapture-dev277205-service-now-now-nav-ui-classic-params-target-catalog-script-client-do-2025-09-22-23_09_29.pngscreencapture-dev277205-service-now-now-nav-ui-classic-params-target-item-option-new-do-2025-09-22-23_09_13.pngscreencapture-dev277205-service-now-now-nav-ui-classic-params-target-u-role-category-list-do-2025-09-22-23_09_00.pngscreencapture-dev277205-service-now-now-nav-ui-classic-params-target-u-sub-category-list-do-2025-09-22-23_08_34.png

 

 

982275ae-ae49-4383-9d77-faea55bb841c.png