Introduction:
Power Apps Collections is a core skill for managing temporary data inside your app. Collections are like in-memory tables that let you store, manipulate, and display data without immediately saving it to a data source.
1️⃣ Creating & Populating Collections
| # | Use Case | Formula | Notes |
|---|
| 1 | Create empty collection | ClearCollect(colEmpty, {}) | Empty placeholder |
| 2 | Collect single record | Collect(colEmployees, {ID:1, Name:"John"}) | Adds one record |
| 3 | Clear and collect | ClearCollect(colEmployees, EmployeesList) | Resets before collecting |
| 4 | Collect multiple records | Collect(colEmployees, {ID:1,Name:"John"},{ID:2,Name:"Jane"}) | Adds multiple rows |
| 5 | Collect from SharePoint list | ClearCollect(colSPList, Employees) | Pulls SharePoint list |
2️⃣ Adding / Removing Items
| # | Use Case | Formula | Notes |
|---|
| 6 | Add a record | Collect(colEmployees, {ID:3,Name:"Mary"}) | Simple add |
| 7 | Remove a record by condition | Remove(colEmployees, LookUp(colEmployees, ID=3)) | Removes matching record |
| 8 | Remove multiple | RemoveIf(colEmployees, Department="HR") | Delegation-safe removal |
| 9 | Update a record | UpdateIf(colEmployees, ID=1, {Name:"John Smith"}) | Update fields |
| 10 | Patch a record | Patch(colEmployees, LookUp(colEmployees, ID=2), {Name:"Jane Doe"}) | Alternative to UpdateIf |
3️⃣ Filtering & Searching Collections
| # | Use Case | Formula | Notes |
|---|
| 11 | Filter by column | Filter(colEmployees, Department="IT") | Returns filtered table |
| 12 | Search by text | Filter(colEmployees, TextSearchBox1.Text in Name) | Partial search |
| 13 | Search with case-insensitive | Filter(colEmployees, TextSearchBox1.Text in Lower(Name)) | Lowercase comparison |
| 14 | Top N items | FirstN(colEmployees, 5) | First 5 items |
| 15 | Last N items | LastN(colEmployees, 3) | Last 3 items |
4️⃣ Sorting Collections
| # | Use Case | Formula | Notes |
|---|
| 16 | Sort ascending | Sort(colEmployees, Name, Ascending) | Alphabetical |
| 17 | Sort descending | Sort(colEmployees, Name, Descending) | Reverse order |
| 18 | Sort by multiple columns | SortByColumns(colEmployees, "Department","Ascending","Name","Descending") | Multi-level sort |
5️⃣ Combining / Joining Collections
| # | Use Case | Formula | Notes |
|---|
| 19 | Append collections | Collect(colAll, colSPList) | Combine two collections |
| 20 | Join with AddColumns | AddColumns(colEmployees, "FullName", Name & " - " & Department) | Add computed column |
| 21 | Merge unique values | ClearCollect(colMerged, Distinct(col1, Name)) | Keep unique names |
| 22 | Lookup join | AddColumns(colEmployees, "ManagerName", LookUp(colManagers, ID=ManagerID).Name) | Simple join |
| 23 | Concatenate values | Concat(colEmployees, Name & ", ") | Returns text string |
Join the conversation! Your thoughts help the community grow.