Dynamic Multiselect?

drewrodrigu
Tera Contributor

Hey there!

I was wondering if there's a standard way to dynamically fill options for a multiselect on a catalog item question/variable?

 

We're making a request based on a previous field's input and then this determines the options for the next field.

 

So far I've tried various approaches, but they all seem like hacky workarounds (like updating a table after our API request comes back and then trying to filter the records to the user).

 

What would be the best approach here?

For a single select, I was able to manipulate the options from a client script just fine, but multiselect requires me to select a table...

4 REPLIES 4

Tanushree Maiti
Tera Patron

Hi @drewrodrigu ,

 

There are two options available.

 

Option 1:

List Collector : A list collector in  ServiceNow is a Service Catalog variable type that enables users to select multiple records from a referenced table (e.g., users, groups, or assets) in a single request.

 

Option 2: ( If choice count is approx  2-5 , otherwise form can break)

You can use a label with multiple CheckBox variables

 

e.g  You  have a Environment variable which has option Dev, Test, Prod

 

So you can take Environment label -> under that 3 checkboxes : for Dev, Test, Prod option

 

Here also user can multi select.

 

Recommended option : Based on  Requirement. List Collector is flexible , easy to implement.

 

 

Hey @Tanushree Maiti! Thanks for the reply. I've explored these two options, but they're both static–the options/values need to be defined ahead of time. But, I need a multi-select that allows me to dynamically update the options/values after an API request after another field updates.

 

There 2 options I'm seeing are:
- List collector: Update records on a table dynamically and then scope them to the user so they can search them. Although, this feels hacky just for a dynamic multi-select—and I still haven't verified a good approach here.
- Custom UI (but we would prefer to use the catalog entry's native UI)

We prefer List Collector for multi select as it is dynamically populated from table.

 

It provides a clean, searchable, and multi-select interface, which is much less tedious for users than selecting from a long list of checkboxes.

 

Dynamic population allows the list to be filtered based on other form fields, ensuring users only see relevant options.