cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pwapp_explorer
Level: Powered On

Populating a collection from a SharePoint List with OnStart

I have data in SharePoint list that I'm using in my App. Instead of waiting for the screen where the data is used for it to load, I want to load the data from the SharePoint list in the OnStart event

 

But, when I say ClearCollect(col_v, MySharePointList), it gets all the fields, but the collection itself is empty

 

How do I get powerapps to populate the collection?

 

I even tried a Forall with a Collection, and it didn't populate anything.

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Populating a collection from a SharePoint List with OnStart

When you use the OnStart property, the action defined there is only executed when the app is opened. If you save and reopen the app, then you will see the SP list being loaded into your local collection.

 

That is not very good for testing (you always need to close/open the app if you want to refresh the data), so one thing that you can do is to have a button with the same expression (and possibly put it in a screen that is not used in the app). Currently you do need to duplicate the function in both places, which is unfortunately, but in ithe future we expect the Select function to work from the OnStart to the button's selection.

1 REPLY 1
Highlighted
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Populating a collection from a SharePoint List with OnStart

When you use the OnStart property, the action defined there is only executed when the app is opened. If you save and reopen the app, then you will see the SP list being loaded into your local collection.

 

That is not very good for testing (you always need to close/open the app if you want to refresh the data), so one thing that you can do is to have a button with the same expression (and possibly put it in a screen that is not used in the app). Currently you do need to duplicate the function in both places, which is unfortunately, but in ithe future we expect the Select function to work from the OnStart to the button's selection.