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.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,366)