In this Power Apps Tutorial, We will discuss how to create Powerapps collection from an Excel Sheet.
Create PowerApps collection from Excel
To create PowerApps Collections from an Excel sheet, We need to follow these below processes as:
- Create an Excel file, Add some records and format that Excel file as Table
- Rename the Excel Table Name
- Create a Canvas app in Power Apps
- Connect a new or existing Data Source and Import from Excel to your App
- Add a Button and Apply the Collection formula for Excel Sheet
- Preview the Canvas app in the Power Apps
- Excel Records added into the Power Apps Collections
Create PowerApps Collection from Excel Sheet – Syntax
Below is the syntax to Create Collection from Excel in PowerApps.
Where,
- Collect = Collection Function Name which is used to create Powerapps Collections
- MyExcelCollection = Collection Name
- ExcelSheetName= Provide the Excel Table Name which contains records that you wants to display in the Powerapps Collections
Create Excel, Add Records, and Format Excel as Table
- Create an Excel file using some sample records as below.
- Open the Excel file, go to the Home tab. Click on Format as Table option and select any table format.
- Change your Excel Table name (Select Table -> Go to Design tab -> Rename Table Name) as Corona_Details and Save it as like the below screenshot.
Create a Canvas app in Power App
- Sign in the PowerApps with your credentials.
- Go to Apps option from the left navigation.
- Select Canvas under the + New app tab from the top of the page.
- Select Tablet layout under the Blank app section as shown below.
Connect a Data Source and Import From Excel to your App
Click on to connect to data from the middle of the page and expand the Connectors (from left navigation). Select the new Data Source as Import from Excel as shown below.
Add a Button and Apply the Excel Collection formula
Here, we will add a button into an Power Apps App and on click of that, we will populate the PowerApps collection.
In the Power apps Screen, add a Button (Click Insert -> Button).
Select the Button and apply the below formula in its OnSelect Property to this function.
OnSelect = Collect(ExcelItemColection,Corona_Details)
Where,
- OnSelect = Button Property Name
- Collect = Collection Function Name
- ExcelItemCollection = Collection Name
- Corona_Details = Excel Table Name
Preview the App in the PowerApps
Now preview the app to see how it works. To preview, click on F5 or Preview icon from right top of the page.
Click on your Collection Name (ExcelItemCollection) and then you can view the first 5 records in the Powerapps Collection.