Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

OnChange Client Script to Populate List Collector

Steven Parker
Giga Sage

So I am playing around in my personal Dev instance and trying to populate a list collector with a few values based on the choice in a Select Box variable:

find_real_file.png

How can I populate multiple values in the right bucket of a List Collector when a Select Box is changed (job_function in this example) to a certain value?   This works for populating 1 value, although it throws up a JavaScript error in the Service Portal which is obviously an issue.   I know the values that need to go in the right bucket when a value is chosen in the select box so I just want to manually populate those 3 or 4 values when the job function is changed to "fsr".   Also, what is causing the JavaScript error on the Service Portal?


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven
10 REPLIES 10

michal_v
Giga Contributor

Hey,


Did you found a solution for it?


Michal



I stopped trying to populate a list collector and populated a hidden text field instead.   We basically told people the list collector was for one off request and when they select a job function, the list collector is hidden and we populate a hidden text field with the apps needed for the job function.   Load those into an array in a Run Script in the workflow and assign them to the proper group.



Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

OK, Thanks.


unfortunately it's not something that will work for my requirement, but thanks


I don't think the portal likes the "moveselectedoptions" or "rightbucket"....because the view on the portal isn't buckets really like it is in the ITIL view.  



If I were you, I would post a new topic on it though.   See if anyone has any experience with that working in the Service Portal.   I would still like to know the answer myself.



Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

Hi Steven,



We have a similar kind of requirement, please suggest me if you could able to solve this issue.



Thanks.