cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Powerapps Multiscreen SP List Form loading cached info until a button is clicked on the form.

I have a power apps SP list form that has 4 tabbed screens. The form works perfectly except for when I load either the FormEdit or FormView. When i click on the item in the SP list and then select Edit the form loads up and only shows my 4 tab buttons but shows a blank screen below it until i click on any of the 4 tabs up top and then the app loads everything else fine. I will let the app sit on the blank screen thinking it is just taking time to load the data but it will sit there only until a button is clicked on the form and then will load the data. After i do this and go back out of the form and then click edit again it will load correctly but this is a pain. I also notice when going from the FormNew to FormEdit or FormView i always see a cached screen of the last page the app left off on before being closed. I have tried all of the "Refresh(Sharepointform)" and the "ResetForm" functions in the OnEdit,OnView fields and also in the OnVisible field of the form but nothing seems to help this behavior. I uploaded a gif of the action i am talking about. Any suggestions would be helpful. Thanks!

7 REPLIES 7
Highlighted
Community Champion
Community Champion

Re: Powerapps Multiscreen SP List Form loading cached info until a button is clicked on the form.

Hello @cpietrucha ,

I have picked your post up from the unanswered list and will try to help you.

Firstly, what is the Visible property of the first tab screen? It will be on the OnSelect of the first tab.

Have you tried setting this code at App OnStart?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Regular Visitor

Re: Powerapps Multiscreen SP List Form loading cached info until a button is clicked on the form.

I have included a picture of what my app setup looks like in powerapps. I have 3 different screens, ScreenNew which is when a new item is created, ScreenEdit which is used to edit the list items and ScreenView which is used to view the list item. Under each screen lives 1 form that houses all datacards. Each datacard has a the Visible property set to either showTab1, showTab2, showTab3 or showTab4 depending on the page I want the datacard to show on.

 

Visible is set to showTab1 on FormNew, FormEdit and FormView  (I have also set Visible to true before using showTab1 and still has the same outcome.)

 

OnSelect for Tab1 is set to Set(showTab1, true);Set(showTab2, false);Set(showTab3, false);Set(showTab4, false) for FormNew, FormEdit and FormView

 

I think I have somewhat fixed the issue by adding the below code into the OnVisible box under ScreenNew,ScreenEdit and ScreenView. The FormEdit part in the code changes based on the screen, meaning FormNew and FormView.

 

If(!loadapp,
FormEdit;
UpdateContext({loadapp: true})
)

 

Now the issue i seem to be having is that when i load either the ScreenEdit or ScreenView i am seeing all datacards on the initial Tab1 page even though some datacards visible property is set to either showTab2, showTab3, or showTab4. I included 2 gifs below to demonstrate the issue.

 

powerapphr1.png

3re3xj.gif3re45n.gif

Highlighted
Community Champion
Community Champion

Re: Powerapps Multiscreen SP List Form loading cached info until a button is clicked on the form.

Thanks @cpietrucha ,

Before I head down the track of looking at your current setup, is there any reason that you have three identical forms for View, New and Edit? I always only have one and simply switch the FormMode as required.

Highlighted
Regular Visitor

Re: Powerapps Multiscreen SP List Form loading cached info until a button is clicked on the form.

I watched a couple videos on building out the form and tabs and most did it this way. Didn't even think about using the FormMode. How would i go about setting 1 form to be used when a user clicks to View the form, edit the form and create a new one?

 

When they create a new form i only want them to see Tab1 and only the contents of Tab1. When they edit or view i want them to be able to view all 4 tabs and be able to click on them and see the datafields in them.

Highlighted
Community Champion
Community Champion

Re: Powerapps Multiscreen SP List Form loading cached info until a button is clicked on the form.

Hi @cpietrucha ,

To change to Edit mode, put

 

EditForm(YourFormName)

 

New form

 

NewForm(YourFormName)

 

For showing/hiding controls (example for new) - just put this on the Visible property of the control 

 

YourFormName.Mode <> FormMode.New

 

This returns a Boolean (true/false) variable which becomes the Visible property of the control and hides the control if the form is in New mode.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

 

 

 

Highlighted
Regular Visitor

Re: Powerapps Multiscreen SP List Form loading cached info until a button is clicked on the form.

I'm not sure i'm understanding. Where should I be putting EditFrom(FormEdit) and NewForm(FormNew)? On the OnVisible control of the ScreenEdit and ScreenNew screens?

 

I'm also confused on how to properly use YourFormName.Mode <> FormMode.New

For example, on the FormEdit and FormView forms should I put this in the Visible control for each datacard? What else needs to be included in the code?

Highlighted
Community Champion
Community Champion

Re: Powerapps Multiscreen SP List Form loading cached info until a button is clicked on the form.

Hi @cpietrucha ,

Assume you have one screen and one form.

On the Edit icon OnSelect, put 

EditForm(YourFormName)

and the form will go into Edit mode

For the New icon

NewForm(YourFormName)

Saving in both cases simply needs a SubmitForm save icon

Back to view

ViewForm(YourFormName)

which you would put on the initial screen navigation and after the SubmitForm when saving.

The the test I mentioned

YourFormName.Mode <> FormMode.New

would be on the Visible property of anything you did not want displayed when the form was in New mode.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

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 (8,447)