cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

PowerApps caching views

I've got a PowerApps application built on a SharePoint list.  When the application loads, it runs a Flow to determine SharePoint group membership and sits at a "Please Wait" screen while that runs.  Once completed, the form logic will display a form screen determined by the Status column in the SharePoint list.

 

Here is what is happening.  When I go to the list and click "NEW," the form loads, runs the Flow, and then sends the form to the "NEW" screen.  I complete the form and submit it.  After the submission is complete, I immediately click "NEW" again.  At this stage, the Flow does not seem to run and the "Please Wait" screen is skipped - the form goes right to the "NEW" view.  It's as if the rules in the OnStart parameter of the App are being skipped  - almost like the previous view was cached.

 

Any thoughts?   I want the rules in the OnStart event of the App to run EVERY time.

 

 

13 REPLIES 13
Highlighted
Super User
Super User

Re: PowerApps caching views

OnStart only runs the code once when the app is intially opened. If you want the logic to run every time the NEW button is clicked why not copy the code from OnStart and use it in the buttons OnSelect as well.

Please Accept as Solution if this post answered your question to help others find it more quickly. If you found this post helpful consider giving it a Thumbs Up!
Highlighted
Advocate II
Advocate II

Re: PowerApps caching views

The New button is the embedded New button in the SharePoint list's ribbon.  I can't control that.

 

If I click that new button, fill out a form, and a submit closes the form, then why isn't it running the OnStart event again when I launch the app? 

Highlighted
Super User
Super User

Re: PowerApps caching views

The app is considered started when you click the New button on your SP List for the first time and is not considered closed until you navigate away from the list in your browser window.

Put the code in the OnVisible property of your screen instead. I was wrong about putting in the button (I did not know it was an SP button I thought it was PowerApps).

Also you should consider checking if the form is in NEW mode before executing code:

If(your_form_name.FormMode=New,your_code_here)


Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
Highlighted
Advocate II
Advocate II

Re: PowerApps caching views

Thanks, I appreciate the help.  Would this issue still be present if I tried to convert this to a Canvas app?   Also, is the order of operations for rules on a SharePoint List PowerApp as follows?

 

1. App OnStart

2. SharePoint Integration

3. Individual screen rules

Highlighted
Super User
Super User

Re: PowerApps caching views

@blanghorst
If you convert to a canvas app you will not have this issue.

Yes, I believe you are correct about the order operations. You could also try putting your code in the OnNew property of the SharePoint Integration. That would work!
Highlighted
Advocate II
Advocate II

Re: PowerApps caching views

You've been a great help.  I'm still having issues but hopefully I'll find time to resolve them this week.

 

Is there any guidance on converting a PowerApps List Form to Canvas App?  For anyone who has done it, how long does it generally take? 

Highlighted
Super User
Super User

Re: PowerApps caching views

@blanghorst 

Unfortunately, you must start over again to convert from list form to canvas app.  See the relevant forum post below.

 

Link To Relevant Forum Post

https://powerusers.microsoft.com/t5/Building-PowerApps-Formerly/Possible-to-convert-a-powerapps-list...

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

Highlighted
Advocate II
Advocate II

Re: PowerApps caching views

Thanks so much for your help.  I'm on the right track and think I have a fix.  I just need to do some more regression testing tomorrow, as the form is very complex and the fixes I implemented were pretty substantial.

Highlighted
Super User
Super User

Re: PowerApps caching views

@blanghorst
I wish you didn’t have to do so much work but at least it sounds like you are in a good spot now. Let me know how the regression testing goes tomorrow

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,366)