Clear List
Clear List
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
list | List | — | The list to empty. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”This activity does not return a value; it modifies the list in place.
Common errors
Section titled “Common errors”| Message | Cause 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). |
Example
Section titled “Example”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: processedInBatchRelated activities
Section titled “Related activities”- Create List — create a new list.
- Remove from List — remove a single element.