cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LeoGS
Helper II
Helper II

Fetching data with "OnStart" - does it make any sense?

Dear all,

 

I became aware of the property "OnStart" of the App object. I read somewhere that "a best practice" is to fetch all data from dynamic data sources to collections using this property.

 

Well... Maybe I am doing something wrong, but it is not as useful as I thought. First of all some extra info:

 

- My data sourceS: Sharepoint Lists

- Possible more than 2000 records? YES

 

I coded lines like:

 

ClearCollect(collectionUsers, dbo_Users),
ClearCollect(collectionSites, dbo_Sites),
ClearCollect(collectionCompletedAudits, dbo_CompletedAudits)

 

My idea behind it is to avoid internet traffic or internet dependence during the use of the app and gather all data from my tables on the beginning. I am getting a warning: "The rows retrieved from the data source may not be complete"

 

I understand it has probably to do with delegation, so that my collections would have MAXIMUM 2000 records.

 

Is there a way to overturn this? If not, I will then NOT fetch data as the app start and rather gather the information as the user navigates to corresponding screens (what WOULD possibly cause delays).

 

Do you have any better idea?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

It is not a Best Practice to gather a lot of information in OnStart.  In fact Microsoft is slowly making changes to make this less possible because it has too great an effect on the startup of the app.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

7 REPLIES 7
JR-BejeweledOne
Super User
Super User

SharePoint has a limit of 2000 rows, but there are ways around it.   Here is a link to an excellent article on the subject.

 

https://matthewdevaney.com/create-power-apps-collections-over-2000-rows-with-these-4-tricks/



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Pstork1
Dual Super User III
Dual Super User III

It is not a Best Practice to gather a lot of information in OnStart.  In fact Microsoft is slowly making changes to make this less possible because it has too great an effect on the startup of the app.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Hello @JR-BejeweledOne ,

 

what do you mean "Sharepoint has a limit of 2000 rows" ?

I have read here (https://docs.microsoft.com/en-us/office365/servicedescriptions/sharepoint-online-service-description... that a Sharepoint List can store up to 30 million items.

 

Or do you mean the amount of items PowerApps can gather from Sharepoint is 2000 rows? Or did you maybe write Sharepoint but you meant Collection?

 

If Sharepoint Lists really have such a small limit, I will need to find another solution and should better stop doing further what I am doing right away, that's why the emergency sound in my question.

 

Thanks your your reply!

Thanks @Pstork1 , so I better do as I was doing and gather (filtered) data from the sharepoint list as the user needs them.

Thanks @Pstork1 , so I better do as I was doing and gather (filtered) data from the sharepoint list as the user needs them.

In Power Apps unless you have a workaround you can only retrieve 2000 rows from SharePoint.  It's a delegation limit that doesn't apply to other data sources.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Pstork1
Dual Super User III
Dual Super User III

Using delegation to work with data sources larger than 2,000 records will provide better performance overall than copying all the records of a large data source to a local collection.  If multiple users are using the data it will also limit data errors caused by users using separate copies of the same data simultaneously.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,471)