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

Data Refresh issues on Screen

Hi,

 

I am facing strange issue with one of my Power Apps. I have developed a app which reads data from Power BI. On Visible property of my Main Screen I am loading data from PowerBIIntegration to one Collection by using some Variable flag (This idea was suggested in this forum) If(VarNum<>0, ClearCollect(Itemstoshow,[@PowerBIIntegration].Data));

 

I am showing this collection on Gallery as items by filtering and sorting the data.

 

Now the problem is whenever I load the app, the data doesnot show up on main screen at first shot. When I switch between screens (go to other screen and come back) data shows up. I dont have any other code written on visible property of other screen also. Is there anything that I am doing wrong here?

Another thing to mention is if I use PowerBIintegration.Data on Gallery items things works just fine. Only this happen because of loading data to collection.
 

3 REPLIES 3
eka24
Super User III
Super User III

If you don't want to refresh after moving from Screens, put the formula OnStart of the App. Not Onvisible.

 

The downside is you need to restart the App

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

narengc
Frequent Visitor

Actually the issue started there..I have put the formula on Onstart of App and it didnt work there ( I had asked this question in the forum separately https://powerusers.microsoft.com/t5/Building-Power-Apps/Collection-as-Gallery-Items/m-p/587579#M1841...)   

so using variable I moved the formula on OnVisible on my Screen.

eka24
Super User III
Super User III

The Onvisible ensure you have a refresh data in the App. That is if any changes occurs to the Datasource. So It the most appropriate place in your scenario.

Not sure why not working OnStart.

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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,581)