Copy row to collection without deleting existing row

RichardL

New Member
I'm convinced I'm doing something silly here, but I'm trying to copy a row from one collection (lets call it Collection A) and write it to a second collection (Collection B). On the first iteration, this is fine, but if I try and copy a second row to Collection B, it wipes the row that was already in there. Does anyone know how to copy a row into a collection without wiping the data in there already?

Just to explain the situation. I have a dataset in a collection, which the process is working through one row at a time to identify if the data is correct or not. If it find's incorrect data, it needs to copy that row to a new collection, where it will be processed at a later stage. Filter collection won't work in this situation, as there too many variables involved.
 

VJR

Well-Known Member
Hi RichardL,

The Copy rows simply copies and overwrites any previous data in the collection.
For instance, if at first 10 rows are copied to the destination collection and then again only 1 row is copied, then in that case only the last copied 1 row will remain in the destination collection and the previous 10 rows are wiped out.

i. You can use a combination of Copy rows and Append Rows
- Copy the desired row from the Original Collection to a temporary collection
- Then Append rows in the Combined collection taken from the rows of the temporary collection
- At the end (of the loop), the combined Collection will be the final one

ii. Another option is to use a combination of Add Rows and a Multi Calc stage to set the value of each column to the final collection directly from the original collection.

If there are more number of columns to set then option i. would be a better approach.
 
Top