cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jonas_Portmann
Frequent Visitor

Check if App is refreshing

Hi there!

 

Problem:

While refreshing a data source I can still select an item form a gallery (connected to that data source). That selection is reset after the refresh is done.

 

Details:

I have a Gallery in Powerapps with a List of Records (from Dynamics CRM). After I create a new Record within my app I will be redirected to this Gallery / Overview page. However, my newly created Record does not show yet. Therefore, I created a variable "refresh" which will be set to true, in order to triggers the Data Source to be refreshed.

If(refresh=true;
     Refresh('Data source XY')
);;UpdateContext({refresh:false})

During this refresh, I still can select a Gallery item. It will open in a new screen ready to be edited. However as soon as the data source refresh is completed, this selection will be reset and inside the screen, there will now be the first item of my gallery. 

 

Question:

Is there any way to either lock the gallery during a reload or check if the app is currently refreshing?

 

I already tried adding a spinner on top of the gallery, which will show when the gallery is empty (IsBlank). However during a refresh, there is already data within the gallery and the spinner will not show.

 

Thanks for any input on this matter.

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

A gallery refresh would simply reset all the Gallery related settings, including the Gallery.Selected.

 

If you would like to keep the Selected data, please try:

ClearCollect(SelectedData, Gallery.selected)

Based on what I know, there is no such feature or function available to either lock the Gallery from refreshing, or check if App is auto-refreshed.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-micsh-msft
Community Support
Community Support

A gallery refresh would simply reset all the Gallery related settings, including the Gallery.Selected.

 

If you would like to keep the Selected data, please try:

ClearCollect(SelectedData, Gallery.selected)

Based on what I know, there is no such feature or function available to either lock the Gallery from refreshing, or check if App is auto-refreshed.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

This is not the solution I was looking for but it works nevertheless. Thank you @v-micsh-msft.

 

The workaround I found for the display component of my problem is that if you Filter the data after a refresh, the gallery will get reset and the IsBlank condition will trigger the spinner again to show.

 

So by combining those two approaches I think I'm able to get a pretty good woorkaround. It would still be nice, if there were some sort of Trigger or Check to see if the app is currently refreshing any or a specific datasource.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,592)