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?
Solved! Go to Solution.
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.
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.
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.