appendToDocumentList: Only last item is getting added

I use the appendToDocumentList inside the loop. Only last time is getting appened to the end document list.

for eg: If the loop contains 3 elements (id = 1,2,3) and if I use appendToDocumentList inside the for loop, I am getting only id=3 after the end of the loop. I should see all the three elements.

Is anybody having the same problem?

Are you mapping “toList” in the inputs of the appendToDocumentList? In every iteration, you must map the new output “toList” of previous step to the input “toList” of next step.

Also check if you are dropping “toList” at the end of the loop, but using it in the input “toList” of appendToDocumentList.

drop the document ,which u are appending to the list, at the end of the loop or right there where u are mapping it to the appendToDocumentList service.

Thank you. You saved my day :slight_smile:

For future reference, you might want to search the forums before posting your questions. This particular issue has been covered many, many times.