Power Fx function
Collect — Power Fx function reference
Add rows to a collection.
Syntax
powerfx
Collect( DataSource, Item1 [, Item2, ... ] )
Examples
powerfx
Collect(colCart, {Item: "Pen", Qty: 2})→ Row added
powerfx
Collect(colCart, {Item: "Pen", Qty: 2, Price: 1.5})powerfx
Collect(colCart, ForAll(galProducts.AllItems, {Item: Title, Qty: 1}))Common mistakes & gotchas
- Collect both creates a brand-new collection on first use and appends to a live data source — against SharePoint/Dataverse it behaves like a Patch(Source, Defaults(Source), Item) per row.
- The first item's shape defines the collection's schema in Studio; a later record with different columns can silently produce blank columns rather than an error.
Related Power Fx functions
From Collections & local storage