cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: Check if App is refreshing

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
Highlighted
Community Support
Community Support

Re: Check if App is refreshing

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

Highlighted
Frequent Visitor

Re: Check if App is refreshing

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (4,256)