flow designer - action output(array.string) not passing the values to subflow

swathi55
Tera Contributor

Hello,

I am trying to pass an array values from the action output to a subflow. but the action is not passing the input to subflow. can someone help me on this.

Action code:

var arr =['abcd','dfjh','hjgkj'];

  for(var i = 0; i < arr.length; i++)
    {
        contactsArray =[];
       contactsArray.push(arr[i]);
    }
    outputs.failures = contactsArray;
 The contactsArray is holding only the last value "hjgkj" its not passing all the values.
I have defined the output variable as array.string.
   
Thanks in Advance.
   
           
               

 

4 REPLIES 4

Nitin Panchal
Tera Guru

Hi @swathi55 , 

Try declaring the array contactsArray out side of for loop .  Like below and it should work. 

var arr =['abcd','dfjh','hjgkj'];
var contactsArray =[];

  for(var i = 0; i < arr.length; i++)
  {
       contactsArray.push(arr[i]);
  }
    outputs.failures = contactsArray;
if my response helped you in any way please mark this response as helpful / mark answer. 
 
Thank you
Nitin

The problem is its not passing the output value to the subflow.. do i need to change the output type?

amol_joshi
Tera Contributor

I have the same problem despite declaring an empty array outside the loop as suggested below. The only thing that comes to the SubFlow is the Status object.

 try:

contactsArray.push(arr[i].toString());