Someone recently asked me if I could create a collection in Power Apps using the OnStart property. If yes, would this impact the app? For all these questions, I can say yes, we can create a Collection on the Power Apps OnStart property of the app without affecting anything.
In this article, I will explain how to create a Power Apps Collection on OnStart property using manually step by step. Also, we will discuss how to create a collection from a SharePoint list using Power Apps OnStart property.
At last, we will see how to sort a Power Apps collection alphabetically either in ascending or descending order.
Power Apps OnStart Property
The Power Apps OnStart Property runs when the user starts a Power Apps app. The OnStart property allows the user to get and store data in the collection by using the collect function.
Create a Power Apps Collection On OnStart Property
Here, I will show you how to create a Power Apps collection OnStart using two ways:
- Create a collection OnStart of a Power Apps manually [without any data source]
- Create a collection OnStart of a Power Apps using the SharePoint list
Create Power Apps Collection Manually
Here, I will show you how to create a Power Apps collection OnStart using the data manually.
I have a Power Apps canvas app related to furniture delivery. The app has a gallery control; when the user OnStarts an app, it displays the furniture arriving soon.

Follow the below steps to achieve this:
- Create a Power Apps blank canvas app.
- Insert two image controls of the furniture on the screen and turn off the visible properties of both images.

- In the Tree view, Click on the App [left-hand side] -> Select the OnStart property and apply the code below:
OnStart =
Collect(
colNewlyFurinitureArrived,
{
Furniture: "Nest Sofa",
'Arriving Date': "08/09/2023",
Image: Sofa
},
{
Furniture: "Dining Table",
'Arriving Date': "11/09/2023",
Image: 'Dining Table'
}
)Where,
- Collect:- Collection function name.
- colNewlyFurinitureArrived:- Provide your collection name.
- Furniture, Arriving Date, Image: These are the columns where the new types of furniture, arriving date, and image will be stored.

- Click on the App, select the More options (…) -> Then click on Run OnStart

- On the left-hand side, click on the Variables (x) -> Expand the Collections -> Then select the Collection name, click on the More options (…) -> Then click on View Table.

- We can see that the Power Apps collection will be created without using any data source.

Now, we will display the Power Apps collection using a Flexible height gallery control.
- Insert the Flexible height Gallery, select the Items property, and then provide the code as the collection name:
Items = colNewlyFurinitureArrivedWhere,
- colNewlyFurinitureArrived: Created Power Apps collection name

- Now, the gallery control will be connected to a created Power Apps collection as shown below:

This is how to create a Power Apps Collection OnStart manually [without using any data source].
Create Power Apps Collection Using SharePoint List
I will show you how to create a Power Apps collection OnStart using a SharePoint list here.
I have a SharePoint list regarding [iPhone Offers], which has different fields like:
| Fields Name | Data Type |
|---|---|
| iPhone ID | Title |
| Models | Choice [iPhone 14pro Max, iPhone 14, iPhone 13, iPhone 12, iPhone SE] |
| Price | Currency |
| Offer | Single line of text |
| iPhone Image | Image |
| Offer Closes by | Date and time |

Using that SharePoint list, we will create a Power Apps collection using the OnStart property.
- Create a Power Apps blank canvas app.
- Click on the Connect to data from the middle of the Screen page -> A dialogue box will appear [left-hand side], Click on the Add data.

- Now expand Connectors. Select the data source as SharePoint, then select the SharePoint site you want to connect to.

- Now, select the SharePoint list, Then click on the Connect button. Now, the SharePoint list will be connected to a Power Apps canvas app.


- In the Tree view, Click on the App [left-hand side] -> Select the OnStart property -> Then apply the SharePoint list collection formula.
OnStart = Collect(coliPhoneOffers,'iPhone Offers')Where,
- coliPhoneOffers: Provide your Collection name.
- iPhoneOffers: SharePoint list name.

- Click on the App, select the More options (…) -> Then click on Run OnStart

- On the left-hand side, click on the Variables (x) -> Expand the Collections -> Then select the Collection name, click on the More options (…) -> Then click on View Table.

- Now, we can see that the Power Apps collection will be created from a SharePoint list as shown below:

Now, we will display the Power Apps collection from a SharePoint list using horizontal gallery control.
- Insert the Horizontal Gallery, Select the Items property, and then provide the code as the collection name:
Items = 'iPhone Offers'Where,
iPhone Offers: Created Power Apps collection name

- Change the Layout section:
Layout = Tile and subtitle on overlay- Now the gallery control looks like the below image:

- Click on the Offer field -> In the Properties pane, change the Color property to black and the Fill property to green as shown below:

When the user opens or runs the app, they should receive an iPhone offer which are available as shown below:

We can create a Power Apps collection using the SharePoint list as a data source by app OnStart property.
Also, you may like some more Power Apps tutorials:
- How to Filter Power Apps Collection
- Power Apps Collection Contains
- Power Apps Collection Contains
- add text input to Power Apps collection
- Sort Power Apps Collection
Conclusion
In this post, I have covered a main topic, such as how to create a Power Apps Collection using the OnStart property. We also covered how to create a collection using a SharePoint list with the OnStart property with a simple scenario.

Preeti Sahu is an expert in Power Apps and has over six years of experience working with SharePoint Online and the Power Platform. She is the co-author of Microsoft Power Platform: A Deep Dive book. As a Power Platform developer, she has worked on developing various tools using Power Apps and Power Automate. She also makes Microsoft 365 videos and shares them on YouTube.