Append to documentList breaking the loop

Can any one help to get this fixed. While using the append to documentList, the loop is breaking and throwing error.
Goal. : I am working on flat to flat file mapping in which I have multiple records. For each record, I need to perform mapping and save to the output flat file structure.
Code : Structure : 1. input flat file converted to the document. 2. Grouped all the record in a record list using " Document groupDocuments" service.
3. performing mapping for each segment using repeat for each record. 4. within the loop, transferring all the mapped segment to one document. 5. Using Append to document list, trying to store all the record. While debuging, till step 4 it is working fine but while executing the 5th step, the flow service throwing error.

Its hard to tell before seeing the document type of stopList. Are tempLoop and stopList are created from same document? Can you compare the base documents of these 2 lists and make sure there are no differences?

1 Like

Appreciated your reply

Actually There no document below the “stopList”.

I tried to replicate the same thing but it didn’t worked. while running it is throwing same error while debugging.

Is there is any alternate solution of Append to documentList

You need to have same document structure with the object you are inserting and the list you are inserting in to. Initializing the list before looping in the items may help you.

Also, a better solution; since you don’t have a list that you need to append, why not just map everything from 1 list to other? All you need to do is to select output field. By the way don’t forget to initialize the output list before the repeat section, if you don’t initialize it it may drop it from the pipeline.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.