cancel
Showing results for 
Search instead for 
Did you mean: 

Append current row to collection 2 when looping through collection 1

stefan.hansen
Level 4
Hi there. I am currently looping through a collection and based on a few criterias I then want to append that row to another collection. Is that possible somehow? I tried using the "Utility - Collection Manipulation - Append Rows to collection" but that does not seem to work as it copies the whole content of the main collection and I only want the row I'm on in the loop.
6 REPLIES 6

Anonymous
Not applicable
First you have to add a row in a collection to be append using ""Collection - add row"" and then use simple calculation stage to add values from one collection to another (i.e. collection2. = collection1.) Using this method you can append a collection row by row

stefan.hansen
Level 4
That Logic makes great sense! But when I try to add a row to Collection 2 (which is empty from the start), using the ""Collection - add row"" I then get this message: Internal : The collection has no current row 

stefan.hansen
Level 4
Anyone know why?

Anonymous
Not applicable
Hi there Stefan,  Can you provide an example? Alternatively, can you provide the criteria for filtering your collection? Josh

Joshi_KumarA_V
Level 3
Hi Stefan,  You can use ""Utility - Collection Manipulation - Append Rows to collection"", but need to do perform few things before.  1. Create a variable of collection type - ""To copy row Collection"" 2. Appned your selected row into this collection by calling the ""Collections - Copy Rows"", - Input parameters: pass your Collection 1, Start Row and End Row (in your case its always the same. Why? Because you want to copy only a single row). - Out parameters: Use the ""To copy row collection"" created in step 1 3. Now use ""Utility - Collection Manipulation - Append Rows to collection"" with  - input parameters: Collection 2 and ""To copy row Collection"" - out parameters : Collection 2 Let me know how it works out for you.   Thanks, Joshi 

stefan.hansen
Level 4
Thanks for the input. I made it work by doing the following: 1. Add a row count when looping through Collection 1 2. Make a collection it copies the row to (it can't be collection 2 as it will remove the data already in there) 3. Use ""Collections - Copy Rows"" with input:   - Collection name: Collection 1  - Start row: Row count  - End row: Row count Output:  - Collection: Copied row 4. Use ""Utility - Collection manipulation - Append Rows to Collection"" with input:  - Main collection: Collection 2  - Collection to append: Copied row Output:   - Combined Collection: Collection 2     I am pretty sure this is also what you mean joshikumarav. Thanks for the help!