How to Create Power Apps Collection from SharePoint List?

In this Power Apps tutorial, I will explain how to create Power Apps Collection from SharePoint List. Then, I will show you how to add a data source to the Power Apps collection.

Furthermore, we will discuss displaying the Power Apps collection on a gallery control. Last, we will work with Power Apps Create Collection From SharePoint List With Filter.

How to Create Power Apps Collection from SharePoint List

We can create a Power Apps collection from different data sources like “SharePoint List”, “Excel Spreadsheet”, and, “SQL”. Also, we can create a Power Apps collection manually (Without using any data source).

  • For example, I have created a Power Apps collection [colEmpDetails] from a SharePoint Online List [Employee Onboarding] and then added a Gallery control to display the Power Apps collection, as shown below.
Create Power Apps collection from SharePoint Online list

Setup a SharePoint Online List

Here, I have created a SharePoint Online list named “Employee Onboarding” and inside this, I have added various columns with different data types like below.

Column NameData Type
EmployeeIDIt is a default Single line of text column and I renamed as “EmployeeID”
EmployeeNameIt is a “Single line of text” column
GenderIt is a “Choice” column
DOBIt is a “Date and time” column, etc…

Now, I want to add this SharePoint Online list to the Power Apps collection by using a Button control [Power Apps collection from SP list]. To achieve the above example, follow the below-mentioned steps. Such as:

  • Open Power Apps with your valid Microsoft 365 credentials -> Create a Canvas app ->
  • Add a SharePoint Online list to our Power Apps Canvas app. For that, click on the + Add data option -> Select a data source as “SharePoint” -> Connect to your SharePoint site -> Choose your respective SharePoint list -> Click on the Connect button.
Create a Power Apps collection using SharePoint list
  • Once, the SharePoint Online list is connected, it will add under the Data section like below.
Create Power Apps collection from a SharePoint Online list
  • Then, select the screen (EmployeeDetailsScreen) -> Insert a Button control -> Set its OnSelect property as:
OnSelect = Collect(
    colEmpDetails,
    'Employee Onboarding'
)

Where,

  1. colEmpDetails = Collection name
  2. ‘Employee Onboarding‘ = Name of the SharePoint Online list
Create a Power Apps collection from a SharePoint list
  • Then, insert a Gallery control and set its Items property as:
Items = colEmpDetails
Create a Power Apps collection from a SharePoint Online list
  • Now, click the button to display the Power Apps collection like below.
Create a Power Apps collection using a SharePoint list

This is how to create a Power Apps collection from the SharePoint Online list.

Power Apps Create Collection From SharePoint List With Filter

For this, I have taken the same Power Apps collection, i.e., [colEmpDetails], and I want to filter the records based on the “Department” column.

For example, when the user selects the Collection of IT department button, the gallery filters and displays the IT department employees. Similarly, if the user selects other button controls, then he/she will get respective records like the one below.

How to filter SharePoint list records in Power Apps collection

To work around the above example, follow the below steps.

  • Open the Power Apps Canvas app -> Select a new screen -> Insert a Button control [Collection of IT department] and set its OnSelect property code like below.
OnSelect = ClearCollect(
    colITChoices,
    Filter(
        'Employee Onboarding',
        "IT" in Department.Value
    )
)

Where,

  1. colITChoices = Collection name
  2. Filter = We can use this function to filter the records in a collection based on one or more criteria
  3. ‘Employee Onboarding’ = SharePoint Online List
  4. “IT” in Department.Value = This is the value that we want to filter in the Power Apps collection
Filter SharePoint List Records using Power Apps Collection
  • Then, insert a Gallery control and set its Items property as:
Items = colITChoices
Filter SharePoint List Records from Power Apps Collection
  • Now, click on the Button control [Collection of IT department] to display the records that are related to the IT Department as shown below.
Filter SharePoint list records from Power Apps collection
  • Similarly, you can insert another two Button controls and set its OnSelect properties codes like below.
OnSelect =ClearCollect(
    colITChoices,
    Filter(
        'Employee Onboarding',                                                 // Collection of Sales department
        "Sales" in Department.Value
    )
)                    




OnSelect = ClearCollect(
    colITChoices,
    Filter(
        'Employee Onboarding',                                                 //Collection of Finance department
        "Finance" in Department.Value
    )
)    
  • Then, insert another two Gallery controls and set its Items property as:
gal_Sales = colSalesChoices                                // Collection of Sales department

gal_Finance = colFinanceChoices                     // Collection of Finance department
  • Now, click the button controls to display the respective items in the Power Apps gallery controls, as shown below.
Filter SharePoint List Records from a Power Apps Collection

This is how to work with Power Apps Create Collection From SharePoint List With Filter.

Also, you may like some more Power Apps tutorials:

Conclusion

Whenever you want to create a Power Apps collection using a SharePoint Online list, you can add the specific SharePoint list as a value in the Power Apps collection.

From this Power Apps tutorial, I have explained all about creating a Power Apps collection from a SharePoint Online list.

Also, we covered how to add a data source (SharePoint List) in the Power Apps collection and how to filter SharePoint list items using a Power Apps collection.