4

Create SharePoint List Collection in Microsoft PowerApps

enter image description here

in this image create static data collection using this code run on Button OnSelect

ClearCollect(SivaEnterprise,{ProductNo: 100,ProductName: "Keyboard",Rate: 500}, {ProductNo: 579,ProductName: "Mouse",Rate: 600}, {ProductNo: 112,ProductName: "DVD",Rate: 1500}, {ProductNo: 856,ProductName: "Modem",Rate: 500}, {ProductNo: 469,ProductName: "Processor",Rate: 5000})

So, How to create this type of collection in PowerApp Application collection from SharePoint DataSource (SharePoint List)

2 Answers 2

2

I happened upon this question/answer and others which I felt were not clear. While the instructions are correct, the reason WHY you need to do this is not. In PowerApps currently, you need to create a link to a SharePoint datasource and connect your Collection to it before you try to use it. However, trying to do this on the OnStart event does not properly populate things. So doing a temporary few steps as indicated in the answer fixes the problem.

To create a Collection variable (myCollection) that links to and holds the contents of a SharePoint list (mySPList) do the following steps:

  1. In your application, add a datasource to your application that connects to your SharePoint list (e.g. mySPList)
  2. Create a temporary page with a button on it.
  3. Change the OnSelect action of that button to be: ClearCollect(myCollection,mySPList)
  4. Run the app and click that button
  5. Stop the app and go back to your OnStart event for your main application and again put in: ClearCollect(myCollection,mySPList)

Steps 1-4 create a Collection that includes the fields/data from your SharePoint list and allows it to be referenced ANYWHERE in your application properly. Step 5 (which is what you probably tried first) allows you to have your list updated at start but does not actually create the list for your application at development time.

You can easily test this now by creating another temporary Data Table and changing the Items property for that table to be the name of your Collection (e.g. myCollection). It will now display the contents of your SharePoint List.

This is very handy for having your application access semi-static content that is not updated by the application (e.g. context-sensitive help fields). It drastically improves the speed of this for your applications where you want to populate a text or HTML field based on Lookups (e.g. LookUp(HTMLHelp,Parent.DisplayName=FieldName,HTML)

0

This way you Add Collection table from your sharepoint List DataSource

First create connection with your SharePoint Site and than SharePoint List,

Create one screen in that created screen take one button control

enter image description here

After Create Button, Add this code Button's onSelect property

ClearCollect(User,Users)

enter image description here

After Run App and Click on Button Your Collection created with All List Items.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.