Accumulating the Activity Output for All Iterations
When using the Loop tab to iterate over an activity, you have the option to specify if you want the Loop to output the cumulative data from all iterations. You can do so by setting the Accumulate checkbox to Yes. If the Accumulate checkbox is not selected, only the output from the last iteration is retained and available for mapping in the downstream activities.
When the Accumulate checkbox is set to Yes, the activity accumulates the data from each iteration and outputs that collective data as an array of objects, where each object contains the output from the corresponding iteration. The accumulated results will be displayed as an array in the downstream activities in the mapper and be available for mapping.
When mapping to an element within an object in the output array of the activity, you must provide the index of the element to which you want to map. For instance, when you click on a property within the object under responseBody, the expression displayed in the mapper will be $activity [<activity-name>] [<<index>>].responseBody.<property-name>. You must replace <<index>> with the actual index of the object to whose property you want to map.
When the Accumulate check box is not selected, the output of the Loop displays an object that contains only the data from the last iteration. Data from all previous iterations is ignored. When mapping to an element in the output object of the activity, when you click on a property within the object under responseBody, the expression displayed in the mapper will be $activity [<activity-name>].responseBody.<property-name>.
The Output tab of the activity changes based your selection of the Accumulate checkbox. The parent element (the name of the activity and the data type of the iteration output) is displayed regardless of your selection. If you set the Accumulate checkbox to Yes, the data type of the parent element is an array of objects. If you did not select the checkbox, the data type of the parent element is an object. The Output tab contents will also be available in the mapper for the downstream activities to map to.