cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stapes
Impactful Individual
Impactful Individual

How do I refresh a screen?

I am viewing a screen, selecting an order from a gallery, then returning back to the first screen. How can I cause this screen to refresh when I return to it. Note: Some of the data should have changed. At the moment this is not happening. I have put all the processing in the OnVisible property of the screen:

Set(LoadingSpinnerVisibility,true);
Coalesce(gvSelectedYear, gvDefaultYear);
Coalesce(gvWeekNo,gvDefaultWeek);
Coalesce(gvStartOfWeek, true);
If(gvStartOfWeek, UpdateContext({toggle2:true, toggle3:false, toggle4:false, toggle5: false, toggle6:false}));
If(gvStartOfWeek, Set(gvStartOfWeek, false));
ClearCollect(outstandingOrders,GoodsInToday.Run(gvWeekNo, gvSelectedYear, gvDaySelected)
);
Set(LoadingSpinnerVisibility,false);

 

I would have assumed it did this each time I return, but no, it does not seem to. I have tried Reset and Refresh. Neither of those expects screen name as a parameter.

 

How do I make this screen refresh?

 

1 ACCEPTED SOLUTION

Accepted Solutions
stapes
Impactful Individual
Impactful Individual

My conclusions were wrong. I put a Notify command at the end of the code block in my OnVisible property. Sure enough, it IS being run every time. Why did I think it hadn't? It is dependent on processes that are not instantaneous.

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@stapes 

I assume the Items property of your Gallery is outstandingOrders.  As an initial troubleshooting step can you please check what the contents of the collection looks like to make sure the proper data was loaded?  I want to know if its an issue with your collection or an issue with the gallery.

 

paintMe.png

stapes
Impactful Individual
Impactful Individual

My conclusions were wrong. I put a Notify command at the end of the code block in my OnVisible property. Sure enough, it IS being run every time. Why did I think it hadn't? It is dependent on processes that are not instantaneous.

@stapes 

Does this mean "problem solved"?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,543)