Power Fx function
ClearCollect — Power Fx function reference
Clear, then refill a collection.
Syntax
powerfx
ClearCollect( Collection, Item1 [, Item2, ... ] )
Examples
powerfx
ClearCollect(colStaff, Filter(Staff, Active))
→ Collection reloaded
powerfx
ClearCollect(colStaff, Filter(Staff, Active = true))
With no items supplied, this just empties the collection.
powerfx
ClearCollect(colCart)
Common mistakes & gotchas
- ClearCollect always fully re-evaluates its source expression — calling it in App.OnStart against a large table adds noticeably to startup time; consider lazy-loading on the screen that needs it.
- Because it clears first, any local-only edits made since the previous load are discarded on the next ClearCollect.
Related Power Fx functions
From Collections & local storage