Create Collection from SharePoint List in PowerApps - SPGuides (2024)

Create Collection from SharePoint List in PowerApps - SPGuides (1)

In this Power Apps Tutorial, we will discuss how to create a PowerApps Collection from a SharePoint List.

Also, we will cover these below topics that are related to PowerApps Collection to SharePoint List:

  • PowerApps create collection from SharePoint List
  • PowerApps SharePoint list to collection
  • PowerApps create collection from datasource
  • PowerApps create collection from SharePoint list column
  • PowerApps collection SharePoint list filter
  • PowerApps collect SharePoint list attachments
  • PowerApps collect SharePoint choice column
  • PowerApps collect SharePoint list column
  • PowerApps collect SharePoint list person field
  • PowerApps collection SharePoint list limit
  • PowerApps collect large SharePoint list
  • PowerApps collection update SharePoint list

If you want to create a collection from an excel in Power Apps, check out how to create PowerApps Collection from Excel.

Table of Contents

  • As from my previous post i.e. PowerApps Collection create and use, you must be learned that what is a PowerApps Collection and how to create a collection in PowerApps.
  • Now we will see how we can create a PowerApps Collection from SharePoint list. To achieve this, we need to follow these below basic steps:
  1. Create a SharePoint List and insert some records into it
  2. Create a new blank canvas app in PowerApps
  3. Connect a new or existing Sharepoint Data source and add the SharePoint list
  4. Insert a PowerApps Button input and apply the List Collections code
  5. Save and Preview the app and then tap the button
  6. View the SharePoint List items i.e. added into the PowerApps Collections

Syntax: Create PowerApps Collection from SharePoint List

You can refer to the below syntax to create a PowerApps collection from the SharePoint list.

Collect(CollectionName, YourListName)

Where,

  1. Collect = This is the collection function Name that is used to create Powerapps Collections
  2. CollectionName = Specify a collection name
  3. YourListName = Provide the SharePoint List Name that contains the records that you wants to display in the Powerapps Collections

Now we will start the step by step process:

  1. Create a SharePoint List and insert some records into it
  • At first, you need to create a SharePoint list on your SharePoint site. And also, you have to insert some new records into it.
  • The below screenshot represents a SharePoint List named Products. This list has some different data types of fields and as well as some records as shown below.
Create Collection from SharePoint List in PowerApps - SPGuides (2)

2. Create a new blank canvas app in PowerApps

  • Sign in to the PowerApps app with your credentials.
  • Go to the Apps section from the left navigation.
  • Select Canvas under the + New app tab from the top of the page.
Create Collection from SharePoint List in PowerApps - SPGuides (3)
  • Enter the name of the app and select the Tablet layout under the Format section. Then hit on the Create button as like the below screenshot.
Create Collection from SharePoint List in PowerApps - SPGuides (4)

3. Connect a new or existing Sharepoint Data source and add the SharePoint list

  • Next, you need to connect the SharePoint List data source and then add the created SharePoint List to PowerApps.
  • Go to the Data tab (from the left navigation pane) -> click on +Add data -> Search SharePoint in the search box as shown below.
  • If there is an existing SharePoint connection, then you can use it directly otherwise you will create a new SharePoint connection by using the “+ Add a connection” option.
Create Collection from SharePoint List in PowerApps - SPGuides (5)
  • Then, select the SharePoint site and as well as choose the SharePoint list (Products). At last click on the Connect button.
Create Collection from SharePoint List in PowerApps - SPGuides (6)
  • Now the SharePoint list (Products) is ready to use in the app as shown below.
Create Collection from SharePoint List in PowerApps - SPGuides (7)

4. Insert a PowerApps Button input and apply the List Collections code

  • On the PowerApps screen, insert a Button control and rename it to Add SP List Items to Collection. Also, you can provide some properties to the button like Background color, Font size, Font text etc.
  • Select the button and apply the below formula on its OnSelect property as:
OnSelect = Collect(colSPListItems, Products)

Where,

  1. colSPListItems = Name of the collection
  2. Products = SharePoint list name
Create Collection from SharePoint List in PowerApps - SPGuides (8)

5. Save and Preview the app and then tap the button

  • Now save, publish, and preview (F5) the app. Just tap on the button. When you will press on to it, then the collection will create and add all the SharePoint list records into it.
Create Collection from SharePoint List in PowerApps - SPGuides (9)

6. View the SharePoint List items i.e. added into the PowerApps Collections

  • To view the SharePoint List collection, go to the View tab -> click on Collections as like below.
  • Once you will click on the collection name (colSPListItems), you can see all the SharePoint list records inside the created collection as shown in the below screenshot.
Create Collection from SharePoint List in PowerApps - SPGuides (11)

That’s how you can create a collection from SharePoint List in PowerApps.

PowerApps create collection from datasource

To work around with the PowerApps create a collection from the data source, you can check out PowerApps create collection from datasource to get some ideas.

Here we will see how PowerApps create a collection from the SharePoint list column.

  • Suppose there is a SharePoint List and it has some various columns. Next, you would like to display some of the SharePoint List columns in a PowerApps collections. So check out the below formula to achieve it.
  • Here, I have taken the same above SharePoint List (Products). Now I would like to display only the Vendor (Choice Data type) and CustomerName (Single line of text Data type) column in the PowerApps Collections.
  • Add a Button control and rename it to View Column from Collections. Select the button and apply the below code on its OnSelect property as:
OnSelect = ClearCollect( colProducts, ShowColumns( Products, "Vendor", "CustomerName" ))

Where,

  1. colProducts = Specify the Collection name
  2. ShowColumns = PowerApps ShowColumns function includes columns of a table and drops all other columns
  3. Products = SharePoint List Name
  4. “Vendor” = SharePoint List Choice column name
  5. “CustomerName” = SharePoint List Singe line of text column name
Create Collection from SharePoint List in PowerApps - SPGuides (12)
  • Please note that the column names must be enclosed in double-quotes. Also please be aware that these functions are not delegatable, so if your list is >2000 items, you will run into problems with them when you create the collection unless you filter the list down to <2000 items.
  • Now save and preview the app. Once you will open the collections (View -> Collections), then you can view the result as shown like the below screenshot.
Create Collection from SharePoint List in PowerApps - SPGuides (13)

This is how we can work with PowerApps to create a collection from the SharePoint list column.

In this scenario, We will discuss how to filter a PowerApps collection from the Sharepoint List. Let’s take some different scenarios.

Scenario – 1:

  • I have a SharePoint list named Blog Sites. This list has six columns with different data types:
  1. Title = By default this is a single line of text data type
  2. Site URL = This is also a Single line of text data type field
  3. Site Rank = Single line of text data type column
  4. Active Or Inactive = This is yes/no field
  5. Site Work = Single line of text data type column
  6. Created By = By default, This is a person field

Refer to the below screenshot.

Create Collection from SharePoint List in PowerApps - SPGuides (14)
  • Now I would like to create a PowerApps collection from the SharePoint List where it will filter only the records of the current logged in user. That means, suppose I am the current logged in user, then my records only visible to me. I can not see others records in the app.
  • To workaround with this, insert a Button control and as well as a Gallery control to the screen. Rename the button control to Click Me! as shown below.
Create Collection from SharePoint List in PowerApps - SPGuides (15)
  • Next, select the button and set its OnSelect property to the below code:
OnSelect = ClearCollect( AllMyData, Filter( 'Blog Sites', Lower('Created By'.Email) = Lower(User().Email) ))

Where,

  1. AllMyData = Specify a Collection name
  2. ‘Blog Sites’ = SharePoint List name
  3. Lower = This function helps to convert a string of text from uppercase to lowercase. To know more details about this function, refer to this article PowerApps Lower, Upper, and Proper function
  4. ‘Created By’ = SharePoint list person field name. Here you need to specify .Email parameter.
Create Collection from SharePoint List in PowerApps - SPGuides (16)
  • Now select the gallery control and set its Items property to the collection name i.e.
Items = AllMyData
Create Collection from SharePoint List in PowerApps - SPGuides (17)
  • Save and preview the app. When you will click on the button, in the gallery, you will see all the records that have been created by you only (current logged in user) as in the below screenshot.
  • Also, you can view the filter records in the created collections section as well named AllMyData.
Create Collection from SharePoint List in PowerApps - SPGuides (18)

This is how to work with the PowerApps collection SharePoint list filter.

Scenario – 2:

  • In this scenario, I would like to filter the SharePoint list Yes/No field and the filtered records will display in a PowerApps Collections.
  • In the below screenshot, When you will press the button (Hit Me), then it will filter the SharePoint boolean field records that contain only the Yes values.
Create Collection from SharePoint List in PowerApps - SPGuides (19)
  • The below screenshot represents the same SharePoint List (Blog Sites) that I have used in the above scenario. Among all the fields, it also has a boolean field named Active Or Inactive. In the collection, the SharePoint list will filter and it will only display the True values.
Create Collection from SharePoint List in PowerApps - SPGuides (20)
  • To do this, apply the below code on Button’s OnSelect property as:
OnSelect = Collect( colBoolData, Filter( 'Blog Sites', 'Active Or Inactive' = 1 ))

Where,

  1. colBoolData = Specify a collection name
  2. ‘Blog Sites’ = Specify the SharePoint List name
  3. ‘Active Or Inactive’ = SharePoint List Yes/No field name. You need to specify the numeric number as 1 to get all the true values from the SharePoint List.
Create Collection from SharePoint List in PowerApps - SPGuides (21)
  • Next, insert a Data table and set the collection name on its Items property as:
Items = colBoolData
Create Collection from SharePoint List in PowerApps - SPGuides (22)
  • Save and preview the app. When you will click on the button, you can see all the true values in the data table control.

To work with Power Apps Filter from SharePoint List, you can check out the tutorial on PowerApps Filter SharePoint List

  • Sometimes you may think that can PowerApps Collections have attachments? Or is there any way to view an attachment in a PowerApps Collections? Overall, Do you want to pull the SharePoint List attachments into a collection using the ClearCollect function?
  • Coming to its answer is if you want to pull the SharePoint List attachments into a collection using the ClearCollect function, I afraid that there is no way to achieve your needs within PowerApps currently.
  • Alternatively, We could only access the SharePoint List item attachments within the Attachments control of an Edit form. For more details about the attachment control, you can check out the PowerApps tutorial on PowerApps Email Attachment Control – How to Use

Do you want to work with the SharePoint Choice column in PowerApps Collection? Check out the below scenarios to get details.

Scenario – 1:

  • In this scenario, I have a SharePoint list named Products. Among all the various fields, there is a Choice column called Vendor.
  • This Vendor column has some choice values like APPLE, DELL, HP, SAMSUNG, etc. Now I would like to create one collection that will display only the SharePoint choice values.
Create Collection from SharePoint List in PowerApps - SPGuides (23)
  • To do this, insert a button control and rename it to Get SharePoint Choices. Then, apply the below formula on its OnSelect property as:
OnSelect = ClearCollect( colChoices, Choices(Products.Vendor))

Where,

  • colChoices = Collection Name
  • Products = SharePoint List Name
  • Vendor = SharePoint Choice column name
Create Collection from SharePoint List in PowerApps - SPGuides (24)
  • Save and Preview (F5) the app. Tap on the button (Get SharePoint Choices) and then go to the Collections (View -> Collections). When you will open the specific collection, you can see all the SharePoint Choice values as shown below.
Create Collection from SharePoint List in PowerApps - SPGuides (25)

Scenario – 2:

  • For this scenario also, I will take the same above SharePoint List (Products) and the same Choice field named Vendor.
  • Here I would like to filter the SharePoint choice column and display the vendor value that contains only APPLE values. All the filtered records will store in a PowerApps Collections.
  • To work around with this, add a Button control and rename it to Click and Get SP Choices. Set the below code on Button’s OnSelect property as:
OnSelect = ClearCollect( colProdChoices, Filter( Products, "APPLE" in Vendor.Value ))

Where,

  1. colProdChoices = Specify the collection name
  2. Products = SharePoint List name
  3. APPLE” = Specify the choice value that you want to filter
  4. Vendor = SharePoint Choice column name. Here you need to specify .Value parameter.
Create Collection from SharePoint List in PowerApps - SPGuides (26)
  • Save and Preview (F5) the app. Click on the button. Now go to created collections (colProdChoices). Here you will get all the APPLE value details as like the below screenshot.
Create Collection from SharePoint List in PowerApps - SPGuides (27)

NOTE:

If the SharePoint Choice column is not multiple-choice, then, in that case, you can try these below formulas:

  • Insert a Gallery control and set its Items property to the below code:
Items = AddColumns(Products, "NewValues", Vendor.Value)
  • Then, create a button and set its OnSelect property to the below code:
OnSelect = ClearCollect(colProducts,Filter(Gallery1.AllItems, NewValues= "APPLE")

This is how we can work with PowerApps collect SharePoint choice column.

Here we will see how to work with the PowerApps collect SharePoint list column. Let us discuss a simple scenario.

  • Suppose there is a SharePoint List with various types of fields. Among them, you want to view some of the fields (may be two or three) in the PowerApps Collections. That means except some fields, you do not want to view all the SharePoint List fields in the collections.
  • From the below SharePoint list named TSInfo Attachments, I want only two column values i.e. Title and Attachment Types. Title is a Single line of text data type and Attachment Types is a Choice column.
Create Collection from SharePoint List in PowerApps - SPGuides (28)
  • To workaround with this, add a Button control (Click me) and set its OnSelect property to the below code:
OnSelect = ClearCollect( colSPValues, ShowColumns( 'TSInfo Attachments', "Title", "AttachmentTypes" ))

Where,

  • colSPValues = Name of the collection
  • TSInfo Attachments = SharePoint List name
  • Title“, “AttachmentTypes” = These are the column names that I want to view in the collections
Create Collection from SharePoint List in PowerApps - SPGuides (29)
  • Now, insert a Data Table control and set its Items property to the created collection:
Items = colSPValues
Create Collection from SharePoint List in PowerApps - SPGuides (30)
  • In the data table control, you need to add these both fields by using the Edit fields section. Once you added those two fields, you may face error in one field due to the SharePoint Choice field.
  • For the SharePoint Choice field, you need to specify its Text property as:
Text = ThisItem.AttachmentTypes.Value

Refer to the below screenshot.

Create Collection from SharePoint List in PowerApps - SPGuides (31)
  • At last, save and preview the app. When you will click on the button (Click me), then all the records will display in the data table as like the below screenshot.
Create Collection from SharePoint List in PowerApps - SPGuides (32)

Do you ever want to collect email addresses from the Person column in Sharepoint List? It’s very simple. Check out the below scenarios.

Scenario – 1:

  • There is a SharePoint List named Book Purchase Info. This list has a People picker or Person field called Book Seller. Now I would like to collect all the email address from the Sharepoint List Person field. The list has some records as shown below.
Create Collection from SharePoint List in PowerApps - SPGuides (33)
  • To do this, take a Button control (Hit Me!!) and set the below code to its OnSelect property as:
OnSelect = ClearCollect( colEmail, ShowColumns( AddColumns( 'Book Purchase Info', "Email", BookSeller.Email ), "Title", "BookPrice", "Email" ))

Where,

  1. colEmail = Collection name where all the Email will store
  2. AddColumns = PowerApps AddColumns function helps to add a column to a table. To know more details about AddColumns function, refer to the article: PowerApps AddColumns Function with Examples
  3. ‘Book Purchase Info’ = SharePoint List name
  4. Email” = Enter new column name where the email will store
  5. BookSeller = SharePoint Person field name
  6. Title“, “BookPrice“, “Email” = SharePoint field names
Create Collection from SharePoint List in PowerApps - SPGuides (34)
  • Save and Preview the app. Click on the button and then go to the Collections that you have created (colEmail). There you can able to view all the person emails in the Email field as like the below screenshot.
Create Collection from SharePoint List in PowerApps - SPGuides (35)

Scenario – 2:

  • In the below screenshot, you can see there are multiple people present in a single SharePoint List item. Now I would like to view all the email addresses individually within a PowerApps Collection.
Create Collection from SharePoint List in PowerApps - SPGuides (36)
  • To achieve this, insert a Button control (Click to collect SP People) and apply the below formula on its OnSelect property as:
OnSelect = ClearCollect( colSPPeople, Ungroup( 'Book Purchase Info', "BookSeller" ))

Where,

  1. colSPPeople = Specify the collection name
  2. Ungroup = PowerApps Ungroup function helps to break into separate records that were grouped together
  3. ‘Book Purchase Info’ = SharePoint list name
  4. “BookSeller” = SharePoint Person Field name
Create Collection from SharePoint List in PowerApps - SPGuides (37)
  • Save and Preview the app. Click on the button i.e. Click to collect SP People and then go to the Collections (colSPPeople). Here, you can able to view all the email addresses separately as shown below.
Create Collection from SharePoint List in PowerApps - SPGuides (38)

This is how to work with PowerApps collect SharePoint list person field.

  • As you know, everything has a certain limit in PowerApps. Similarly, PowerApps Collection items have certain limits. If the item crosses beyond its limit, then you will see a warning issue. This issue is known as the PowerApps Delegation issue.
  • Do you worry about Delegations issues in PowerApps Collection? Also, if you want to know how to overcome this issue, then follow the below link to get all the details on PowerApps Collection SharePoint list limit

Suppose in case, your SharePoint list is having more than 3000 records. But unfortunately, the PowerApps collection limit is only 2000 records. Then in that case what you will do to resolve the issue? You can check out PowerApps collect a large SharePoint list to overcome this type of issue.

Do you want to update the SharePoint list from the collection itself? If so, then you can refer to the article on PowerApps collection update SharePoint list

Also, if you want to update the items in the PowerApps collection, then check out a tutorial on How to Update collection item in PowerApps

Also, you may like these below PowerApps Tutorials:

  • PowerApps Find Function
  • PowerApps Mod Function
  • PowerApps Trim Function
  • Upload PowerApps Attachments to SharePoint Library Folder
  • Power BI integration with PowerApps Portals
  • Power Apps Azure AD Group
  • Power Apps RSS Feed
  • PowerApps Weather
  • PowerApps Twitter Connector
  • Power Apps Calculate + 13 Examples
  • Build a Calculator in Power Apps
  • Power Apps Slider Control
  • Power Apps Rating Control – How to use
  • Power Apps Gallery Pagination
  • PowerApps Functions Tutorial
  • Power Apps Export Import Control – How to use
  • Migrate PowerApps from one tenant to another
  • Power Apps PDF Viewer – Complete tutorial

In this Power Apps Tutorial, we discussed how to create a PowerApps Collection from the SharePoint List.

Also, we covered these below topics that are related to PowerApps Collection to SharePoint List:

  • PowerApps create collection from SharePoint List
  • PowerApps SharePoint list to collection
  • PowerApps create collection from datasource
  • PowerApps create collection from SharePoint list column
  • PowerApps collection SharePoint list filter
  • PowerApps collect SharePoint list attachments
  • PowerApps collect SharePoint choice column
  • PowerApps collect SharePoint list column
  • PowerApps collect SharePoint list person field
  • PowerApps collection SharePoint list limit
  • PowerApps collect large SharePoint list
  • PowerApps collection update SharePoint list

Create Collection from SharePoint List in PowerApps - SPGuides (39)

Bijay Kumar

I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com

Create Collection from SharePoint List in PowerApps - SPGuides (2024)
Top Articles
Latest Posts
Article information

Author: Golda Nolan II

Last Updated:

Views: 6550

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Golda Nolan II

Birthday: 1998-05-14

Address: Suite 369 9754 Roberts Pines, West Benitaburgh, NM 69180-7958

Phone: +522993866487

Job: Sales Executive

Hobby: Worldbuilding, Shopping, Quilting, Cooking, Homebrewing, Leather crafting, Pet

Introduction: My name is Golda Nolan II, I am a thoughtful, clever, cute, jolly, brave, powerful, splendid person who loves writing and wants to share my knowledge and understanding with you.