cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Konditoren
Frequent Visitor

Weird onstart behaviour causing extremely slow load

I have an app with extremely high load times on start - 30-40 seconds. There are many controls yes, but the onstart is pretty optimized and according to monitor the load screen times themselves aren't too bad, maybe a couple of seconds. However the monitor also shows that for about 30 seconds the app is just doing random lookups without a datasource and returning nothing. I have never seen anything like this. What could be causing this issue? 

 

 

 

whatisthis.pngwhatingodsname.png

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @Konditoren 

In addition to what @WarrenBelz says , I agree with you that cross screen dependencies are a possible culprit.

These multiple lookups can caused by gallery controls with dropdowns that reference lookup (possibly hidden galleries), or formula that calls LookUp from within AddColumns.

As a further debugging excercise, you could search your app for possible places where you apply this type of pattern, and then work backwards to find the culprit.

 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

@Konditoren ,

It would help to share your OnStart code (in text). Also your screen OnVisible for the landing screen and whether you have any OnChange events in controls on this screen.

Konditoren
Frequent Visitor

As @WarrenBelz  reminded me, here's the onstart and startscreen code:

 

Set(
varAppO365User,
User()
);

Concurrent(

Set(
varEnvironment,
LookUp(
'Environment Variable Values',
'Environment Variable Definition'.'Schema Name' = "disp_EnvironmentType"
).Value
),

// Set(varAppChangeRequest, First('Change Requests')),
Set(varIsChangeManagement, false),
Set(varAppFont, Lato),
Set(
varAppSystemUser,
LookUp(
Users,
'User Name' = varAppO365User.Email)),
Set(
varAppRecommendation,
Blank()
),
Set(
varIsSubmitApp,
false
),
Set(
varIsAdminChange,
false
),

Set(
varEditUrl,
Value(Param("isEdit"))
),
//Get document record
Set(varAppDoc, LookUp(Document_prods, 'External Doc ID' = Param("docID") )),
//Get Dispensation record
Set(varAppDisp, LookUp(Dispensation_prods, ID = Param("dispID") )),
//Get action record
Set(varAppAction, LookUp('Action Prods', ID = Param("actionID") )),
//Get Contributor record and flag that user is contributor
If(Value(Param("contributorID")) <> 0 , Set(varAppContribution, LookUp(Contributors, ID = Param("contributorID"))) & Set(varIsContributor , true)),
//Flag author
If(Value(Param("isAuthor")) = 1 , Set(varIsAuthor , true)),
//Flag Owner
If(Value(Param("isOwner")) = 1 ,Set(varIsOwner , true)),
//Flag Approver
If(Value(Param("isApprover")) = 1 , Set(varIsApprover , true)),
//Flag action commenter
If(Value(Param("isActionComment")) = 1 , Set(varIsActionRespComment , true)),
//Flag Action completer
If(Value(Param("isActionCompleter")) = 1 , Set(varIsActionRespCompleter, true)),
//Flag admin
If(Value(Param("isAdmin")) = 1 , Set(varIsAdmin , true))
);

 

 

 

START SCREEN

If(
(Not(
LookUp(
Document_prods,
'External Doc ID' = Param("docID")
).'Document State' = 'Document State'.Valid
) || LookUp(
Document_prods,
'External Doc ID' = Param("docID")
).'FR, GL or I - Document' = 'Yes/ No/ NULL'.Yes) && Value(Param("dispID")) = 0,
'Document Not Found',


Value(Param("initiate")) = 1,
'Initiate DISP',
'Dispensation View'
)

 

 

Someone surmised these lookups might be related to cross-screen dependencies (of which I have a couple and I aim to weed them out). He theorized that these cross-screen control references might trigger a cascading event of loading everything between screens as well as any lookups that might be in such a control. No  OnChange on the start screen.

 

I've tested all this code in a brand new experiment app and these weird lookups don't happen there. Leading me to believe onstart can't be the issue. 

 

Hi @Konditoren ,

You have five lookups in your OnStart and another two in your OnVisible including a Not(). You also have a number directly on a a Parameter, so I assume it will always be there (OnStart). The ones on your Start screen OnVisible however need to be on a Variable, so create some for that.

As a debugging exercise, firstly get rid of the Concurrent to eliminate dependencies and then comment out bits until the issue goes away and you should find the culprit.

timl
Super User
Super User

Hi @Konditoren 

In addition to what @WarrenBelz says , I agree with you that cross screen dependencies are a possible culprit.

These multiple lookups can caused by gallery controls with dropdowns that reference lookup (possibly hidden galleries), or formula that calls LookUp from within AddColumns.

As a further debugging excercise, you could search your app for possible places where you apply this type of pattern, and then work backwards to find the culprit.

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,250)