cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mangescom
Level: Powered On

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

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

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

Mangescom
Level: Powered On

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (1,548)