Here’s a bug I see in a lot of first Power Apps projects: a Load button fills a collection, and every click adds the same rows again. Click it three times and the gallery shows every request three times.
The Power Apps ClearCollect function fixes that in one call. It empties the collection and then fills it again, so the result is the same no matter how often the formula runs.
In this tutorial, I’ll show you how the power apps clearcollect function works, with six tested examples: typed records, a drop-down list, SharePoint rows, a reload on OnVisible, the 500-row limit, and the table it returns.
Power Apps ClearCollect Function Syntax
ClearCollect( Collection, Item, ... )
| Parameter | Required | Type | Description |
|---|---|---|---|
Collection | Yes | Collection | The collection to clear and then fill. It’s created if it doesn’t exist yet. |
Item, … | Yes | Record, table or value | One or more records or tables to add. A single value lands in a column named Value. |
Return value: the modified collection as a table. Most formulas ignore it, but Example 6 uses it.
ClearCollect is a behavior function, so it only works in action properties like OnSelect, OnVisible or App.OnStart. With a data source it can’t be delegated (see delegation in Power Apps): Power Apps copies only the first batch of rows, 500 by default.
When to Use the ClearCollect Function in Power Apps
- A Load or Refresh button that should replace rows, never append them.
- A screen’s OnVisible that rebuilds a list each time the screen opens (OnStart vs OnVisible explains the difference).
- A short, fixed list of choices for a drop-down.
- A filtered local copy of a SharePoint list or Dataverse table that several controls read.
New to collections? Start with how to create a collection in Power Apps.
Example 1: Create or Reset a Collection With Records
Kevin Brooks in IT wants an equipment cart in his canvas app that starts with the same three items every time he presses a button.
Here’s where every formula in this post goes: select the control, pick the property in the drop-down left of the fx bar (OnSelect here), and type in the formula bar. To test, press Play or hold Alt and click the button.

ClearCollect(
colCart,
{Item: "Laptop dock", Qty: 2, Price: 129.5},
{Item: "Wireless mouse", Qty: 4, Price: 24.95},
{Item: "27-inch monitor", Qty: 1, Price: 219}
)
A label below it shows the rows with the Concat function:
"Rows in colCart: " & CountRows(colCart) & Char(10) &
Concat(colCart, Item & " | Qty " & Qty & " | " & Text(Price, "$#,##0.00"), Char(10))

How does this work?
colCart is the collection, and each { } block is one record whose field names become columns. I clicked the button three times and the label still said Rows in colCart: 3.
Example 2: Load a List of Values for a Drop-Down
Maria Torres needs a Department drop-down with five fixed values. A button’s OnSelect gets:
ClearCollect(colDepartments, ["IT", "HR", "Finance", "Sales", "Marketing"])
Set the modern drop-down’s Items to colDepartments and ItemDisplayText to ThisItem.Value.

How does this work?
Each item in the brackets is a single value, so ClearCollect stores it in a Value column. The drop-down listed IT, HR, Finance, Sales and Marketing, and picking Finance showed Picked: Finance | Rows in colDepartments: 5.
Example 3: Copy Filtered Rows From a SharePoint List
Our Service Requests list on /sites/SPGuides has 623 tickets with a Status choice column. Jordan Ellis only wants the New ones:
ClearCollect(
colNewRequests,
Filter('Service Requests', Status.Value = "New")
)


How does this work?
Status.Value = “New” is a condition SharePoint evaluates itself, so the filter on the SharePoint list ran server-side and Power Apps Studio showed no warning. ClearCollect replaced the collection with 210 rows, starting with Laptop replacement #1000.
Example 4: Reload a Collection When a Screen Opens
A Power Apps collection doesn’t refresh itself when SharePoint changes. Select the screen in the tree view, pick OnVisible, and type:
ClearCollect(
colInProgress,
Sort(
ShowColumns(
Filter('Service Requests', Status.Value = "In Progress"),
ID, Title, Priority, DueDate
),
DueDate,
SortOrder.Ascending
)
)


How does this work?
Filter keeps In Progress tickets, ShowColumns keeps four columns, and the Sort function puts the oldest due date first. The result: 207 rows, starting with Teams phone #1280 due 01/05/2026.
Pro Tip: Pressing Play on the screen you’re editing didn’t run its OnVisible in my test (0 rows). Navigate to the screen, or add a Reload button with the same formula, as I did.
Example 5: Why Power Apps ClearCollect Stops at 500 Rows
Now copy the whole 623-item list:
ClearCollect(colAllRequests, 'Service Requests')
A label shows the count and the highest ID:
"Rows in colAllRequests: " & CountRows(colAllRequests) & " | Highest ID: " & Max(colAllRequests, ID)

How does this work?
With no filter to delegate, Power Apps fetched only the first batch. The label read 500 rows, highest ID 500, and Studio showed no warning at all. You can raise the data row limit in Power Apps (up to 10,000), or load the list in chunks as the collection tutorial linked above shows.
Example 6: Use the Table ClearCollect Returns
Because ClearCollect returns the collection, you can count it in the same formula:
Notify(
"Loaded " & CountRows(
ClearCollect(colClosed, Filter('Service Requests', Status.Value = "Closed"))
) & " closed requests",
NotificationType.Success
)

How does this work?
The inner ClearCollect runs first and hands its table to CountRows. The Notify function then showed Loaded 206 closed requests, with no extra variable.
ClearCollect vs Collect vs Clear
I tested all three on colCart. After Example 1 (3 rows), a button with this formula ran three times:
Collect(colCart, {Item: "USB-C cable", Qty: 3, Price: 12.99})

| Function | What it does | colCart in my test |
|---|---|---|
Collect | Adds rows, keeps old ones | 3 -> 6 after three clicks |
ClearCollect | Empties, then adds | 6 -> 3 |
Clear | Removes every row | 3 -> 0 |
In Power Apps, use ClearCollect to load or reload, Collect to add one item, and Clear to empty a cart. To delete only some rows, see the Remove function.
Common Mistakes with the Power Apps ClearCollect Function
- Wrong property: ClearCollect in a label’s Text gives “Behavior function in a non-behavior property. You can’t use this property to change values elsewhere in the app.” Move it to OnSelect or OnVisible.
- Silent 500-row cap: no warning appeared on a whole-list copy, so compare CountRows with the list’s real item count.
- No write-back: changing a collection never changes SharePoint. Use the Patch function to save.
- Empty isn’t blank: check a zero-row collection with IsEmpty (IsBlank vs IsEmpty).
- Names are app-wide: a collection filled on one screen is the same collection on every screen.
Wrapping Up
The Power Apps ClearCollect function is Clear plus Collect in one behavior formula, so loads and reloads never stack duplicate rows. Let a delegable Filter do the heavy lifting, and watch the 500-row limit on whole-list copies.
For more, see all Power Apps functions and the ClearCollect function on Microsoft Learn.
Other Power Apps functions you may find useful:

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.