cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Refresh SQL Views and populate collections - most current data not displaying in collection

I have a start page for our app and an "Enter" button.  We are using SQL as our datasources. On the click event of the enter button,  I have this code:

 

Refresh('[dbo].[vwPortfolio]'); Refresh('[dbo].[vwSubportfolio]'); Refresh('[dbo].[vwFacility]'); Concurrent(ClearCollect(colPortfolio,Sort('[dbo].[vwPortfolio]',PortfolioName)),ClearCollect(colSubportfolio,Sort('[dbo].[vwSubportfolio]',SubportfolioName)),ClearCollect(colFacility,'[dbo].[vwFacility]'),LoadData(colFaciltyImages,"cTempFacilityImages", true ));Navigate(PortfolioScreen,ScreenTransition.Cover);

 

For a sample reference, vwPortfolio is a SQL Data Source querying off a table called Portfolio in an Azure SQL database.  

 

After the above code runs, a page with a gallery appears.  The gallery is bound to the collection "colPortfolio" - which was populated with the data from "vwPortfolio"  If one of our clients adds any data through our separate external web application to the table "Portfolio", then run the Powerapp (from the start page), any new values recently added do not show.  If I remove the ClearCollect and bind the gallery on the next page directly to vwPortfolio, all the data from SQL shows.  

 

Is this code incorrect?  What is the protocol for filling collections with the most recent data from SQL when the app is run from the start page?  It seems as if "Refresh" is not working the way I have this implemented.

 

Thanks

 

 

 

1 REPLY 1
Community Support
Community Support

Hi @DCooper14 ,

 

If all data could show using the gallery, then ClearCollect should also be able to collect all the same data. If the newly added data does not show, please try to click on the button again and test.

 

Regards,

Mona

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

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,740)