Dynamically add items to List Collector from client script

pgiroux
Tera Contributor

Hi,

Just wondering if it's possible to dynamically add items to a list collector from within a client script.

The problem I'm trying to solve is the fact that we're grabbing information from a server script include - which reaches out to the ECC queue - and its returning information from a MID server powershell script to the client script.

We would like to have the ability to select one or more items when the results are returned. Currently I'm using a select box (with .addOption), but you can't select more than one at a time.

Is there anyway of transforming a List Collector variable (or a different form variable) into a multi-select variable that you could dynamically populate from a client script?

5 REPLIES 5

sachin_namjoshi
Kilo Patron
Kilo Patron

Please refer below which has code to dynamically populate list collector.



https://www.servicenowguru.com/scripting/client-scripts-scripting/move-list-collector-options/



REgards,


Sachin


Hi Sachin, this is not what I'm looking for.



This simply "allows you to move one or more selected options from one side of a list collector variable slushbucket to another"



I need to be able to dynamically add entries to the list without storing it in a static table first.


dvp
Mega Sage
Mega Sage

inorder to use list collector variable you need to store the data received from mid server in a table and display the values


pgiroux
Tera Contributor

Hi dvp, I thought of doing this, but I would have to target one table specifically, and it would be a lot of work instead of just being able to dynamically add items into the list collector directly. (or if there is another variable that you can select multiple entries that may work as well).