How to set array values to list field through OOB flow designer create catalog task ??

Manikantahere
Tera Contributor

I am having custom action as shown below which is giving me array of sys Ids. 
req-1.png

I am passing the above action out put (the same array) as input to the below subflow. 

req-2.png

Inside the flow I am having a create catalog task action where I need to set those array/set of values to additional assignee list. Here you are not seeing the input but in my subflow I have given input.approverList to aditonal asignee list.

req-3.png

But its setting the values as below? how to process them or set them as expected?

req-4.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Manikantahere 

Do this

1) ensure your output type is string and not array

2) in your script use toString() as in the output I could see same sysId getting added again and again

array.push(user.sys_id.toString());

3) then do this

outputs.arraylist = array.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Manikantahere 

Do this

1) ensure your output type is string and not array

2) in your script use toString() as in the output I could see same sysId getting added again and again

array.push(user.sys_id.toString());

3) then do this

outputs.arraylist = array.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

 

for(var i=0; i<inputs.approvallist.length; i++){
             var userGr1 = new GlideRecord("sys_user");
        userGr1.get(inputs.approvallist[i]);
        emails += userGr1.email + ';'; ​

 

I am taking same array as input to get the corresponding mails but I am not getting them instead I am receiving as undefined or  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; etc.

can you correct me what went wrong?

@Manikantahere 

Did my approach worked for setting the additional assignee list field?

Debug in your script if you are getting the sysIds correctly?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader