Skip to content

Clear List

Type: list-clear  ·  Package: Collections Activities v1.0.3  ·  Output: none

Empties a list: removes all its elements, leaving it ready to reuse. Useful to reset an accumulator between rounds of a process.

Removes every element from list. It is the same list, now empty: any variable pointing to it sees the change. Clearing a list that is already empty is not an error.

ParameterTypeDefaultDescription
listList—The list to empty.

None.

This activity does not return a value; it modifies the list in place.

MessageCause and fix
'list' must be a List, got ….list is not a list (the message shows the type received, or null if the variable is empty).
For Each items = batches itemVariable = batch
└─ activities:
Clear List list = accumulated // resets the accumulator for each batch
... process the batch accumulating into 'accumulated' ...
List Count list = accumulated → output: processedInBatch