Description
After creating a record producer and attaching a variable with type List Collector, the variable displays correctly when accessing the record from the service catalog and the slushbucket appears; however when accessing it through Service Portal a Select Box appears instead of a slushbucket.
Steps to Reproduce
- Login any current instance as administrator.
- In the Navigation filter, type: sc_cat_item_producer.do to create a new record producer
- Assign a name, select any table
- Under the Accessibility section, select a Catalog: Service Catalog, and Category: Services.
- Right click header and Save
- Under the Variables related lists, select New and when the Variable form appears
- Under type select List Collector
- In the Question, tab fill in the Question and Name mandatory fields. For example, Role(s) and role
- In the Type Specifications tab, select a List table. For example, Role [sys_user_role] table
- Click Submit
- When going back to the Record Producer, select the Try It on the top right hand side of the header
The slushbucket displays (as expected) - In the Navigation filter, go to Service Portal > Service Portal Home
- Search for the record previously created
- Navigate into that record
The slushbucket does not appear, but in it's place, a Select Box type variable appears.
Workaround
This is expected behaviour and by design in all currently supported releases. Service Portal implemented a new list collector and glide list element type that looks like a reference field but allows the user to select multiple items (but not multiple items at once).
The following script is not meant to allow user to select multiple items at once. It is a new g_list api in Service Portal client scripts to add a filter and add and remove items.
Like this:
function onLoad() {
var myListCollector = g_list.get("my_list_collector");
myListCollector.reset();
myListCollector.setQuery("active=true^category=8c7b22230b402200b0b02c6317673a62");
myListCollector.addItem('3a700d39af5f4fc0aab978df90f4c692', 'Power Supply');
myListCollector.addItem('1cb93419a3a248318da8f814140b42f6', 'Backpack');
}
Related Problem: PRB687167