COMPLETE GUIDE TO POWER APPS COLLECTION FUNCTIONS



While working in PowerApps with collections, performance should be managed right from keeping the sizes of these collections optimized; for large collections can delay the execution of the applications.

Since collections are kept in memory, avoid holding important data in them that would want persistence; external data sources are best suited for that.Another important point is to make your queries on the collections delegation-friendly, especially in large data sets. Also, always clear or initialize any collections to prevent leftover data issues. Finally, collections are reset each time the application is closed, so data management must be adjusted to accommodate this accordingly.



ClearCollect

ClearCollect(colStudents, {Name: “Akira”, Age: 18}, {Name: “Alice”, Age: 22});
Copied!


Collect

Collect(colStudents, {Name: “Nirav”, Age: 20});
Copied!


Clear

Clear(colStudents);
Copied!


Remove

Remove(colStudents, LookUp(colStudents, Name = “Akira”));
Copied!


RemoveIf

RemoveIf(colStudents, Age < 20);
Copied!


Update

Update(colStudents, LookUp(colStudents, Name = “Akira”), {Age: 21});
Copied!


UpdateIf

UpdateIf(colStudents, Age = 18, {Age: 19});
Copied!


AddColumns

ClearCollect(colUpdatedStudents, AddColumns(colStudents, “Status”, If(Age >= 21, “Adult”, “Minor”)));
Copied!


DropColumns

ClearCollect(colUpdatedStudents, DropColumns(colStudents, “Age”));
Copied!


ShowColumns

ClearCollect(colFilteredStudents, ShowColumns(colStudents, “Name”));
Copied!


LookUp

LookUp(colStudents, Name = “Murakami”);
Copied!


FirstN

ClearCollect(colFirstTwo, FirstN(colStudents, 2));
Copied!


LastN

ClearCollect(colLastTwo, LastN(colStudents, 2));
Copied!



Note by Akira28

  • Performance: Minimize collection size to prevent slowdowns.
  • Memory: Large collections may exhaust device memory.
  • Data Persistence: Collections reset when the app closes, so store critical data externally.
  • Delegation: Ensure collection operations are delegation-friendly for larger datasets.
  • Initialization: Always clear or initialize collections to prevent residual data issues.
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Serafima

Yo man, as a comp.linguist in my bachelor, I recently got a student job which is all about PowerApps development, so as my chefs gave me some time for self-education it this new field, I am searching my butt off for the good blogs, and there’s not much of them. But sincerely I ADORE this page!!!!!!!! It’s so stylish and cool, and I really like how precise it is for people with some coding background, maybe some citizen devs would like to read more, but for me here – JUST what I needed! Would be nice to learn from you, that’s a great job! Keep going bud and I wish you all the best 😀