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.

How to set multiple values in List Collector Variable using Script ?

Ayushi1
Tera Contributor

Hi All,

I have one Variable which is referring to the sys_user table and when that variable is set then i need to auto-populate the users groups in the list collector variable.

Please help me to set the groups of user in the list collector variable. 

 

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hi Ayushi,

You could set the glide_list attribute on the List collector to make it behave like a normal platform List field. Once the attribute is set, you can set comma separated sys_id's of users directly using g_form.setValue('') without any complex scripting in it. Also it will work on service portal as well.

ie g_form.setValue('list_field' , '1,2,3,4,5'); // comma separated sys_id's of user.

Refer https://docs.servicenow.com/bundle/newyork-it-service-management/page/product/service-catalog-manage...

Thanks!

View solution in original post

6 REPLIES 6

Lon Landry4
Mega Sage

Links above do not work. Most ServiceNow articles with links no longer work...

Yeah most of the links are just redirecting to home page