In simple words, collection by mean is a group of items. Power Apps provides most useful feature i.e. Power Apps Collection. It is an array that is use to keep data in Power Apps memory.
Create a Collection in Power Apps
Syntax
Collect (Collection Name, record(s))
Here,
Collect = this is the default function name provided by Power Apps to create the collection.
Collection Name = we need to give any name to our collection.
Record(s) = we are providing values to our collection, each record stores item values within curly braces.
Steps to Create Collection
Step 1
Open Power Apps window. Select OnStart Property.
Step 2
Let’s take a simple example for Employee details showing employee id and designation. Add the following formula OnStart method.
Collect (EmployeeDetails, {EmpID: "11021051", Designation: "Software Developer"}, {EmpID: "11021052", Designation: "Product Manager"}, {EmpID: "11021052", Designation: "HR"})
Step 3
Now save and publish the app. And reopen the app in edit mode. Go to View ->Collections.
Step 4
Clicking on Collection will show you the collection you have made.