cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

How to refresh a SQL Table in powerapps

Friends,

 

I have successfully been able to call on SQL tables and views in my powerapp.  This is revoutionary for my app.  However, now that it is connected and working, I'm not sure how to update the data.  When something is done that updates one of the tables, I can view the talbe in MySQL studio and see that the table is updated.  However, my app will not update with the new data unless I exit the app, and reopen.  I have attempted using Refresh('datasource') and that does not seem to work.  I am using these values in a browsegallary to indicate certain status's.  Any ideas?

 

Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: How to refresh a SQL Table in powerapps

When you make updates to the table that backs the view, you need to call Refresh passing the view itself (to retrieve data again), not the table. Right now PowerApps doesn't have a way to know that if you update a table it needs to update the views that depend on that table.


So if you have a table called '[dbo].[Products]' and a view called '[dbo].[vwBestProducts]' which is displayed on a gallery, once you make an update to the Products table, you need to have this expression to refresh the data from the gallery:

Refresh('[dbo].[vwBestProducts]')

 

5 REPLIES 5
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: How to refresh a SQL Table in powerapps

When you make updates to the table that backs the view, you need to call Refresh passing the view itself (to retrieve data again), not the table. Right now PowerApps doesn't have a way to know that if you update a table it needs to update the views that depend on that table.


So if you have a table called '[dbo].[Products]' and a view called '[dbo].[vwBestProducts]' which is displayed on a gallery, once you make an update to the Products table, you need to have this expression to refresh the data from the gallery:

Refresh('[dbo].[vwBestProducts]')

 

Super User
Super User

Re: How to refresh a SQL Table in powerapps

Hmm... simple enough.  I'm surprised I didnt try that.  Thank you.

Anonymous
Not applicable

Re: How to refresh a SQL Table in powerapps

Hi @CarlosFigueira,

 

I'm having the same problem - what do you mean  by the "View" sorry? Let's say I'm refreshing a DataTable - are you saying I refresh it from the DataTable itself and if so, where abouts do i enter the command?

Super User
Super User

Re: How to refresh a SQL Table in powerapps

An SQL view is a table created through various SQL commands to combine tables, along with filters and such to reduce the number of calls and nested filter searches that I do in powerapps.  A "view" is handled the same in powerapps compared to a pure SQL table.  

Highlighted
DE1
Level: Powered On

Re: How to refresh a SQL Table in powerapps

 


@CarlosFigueira wrote:

When you make updates to the table that backs the view, you need to call Refresh passing the view itself (to retrieve data again), not the table. Right now PowerApps doesn't have a way to know that if you update a table it needs to update the views that depend on that table.


So if you have a table called '[dbo].[Products]' and a view called '[dbo].[vwBestProducts]' which is displayed on a gallery, once you make an update to the Products table, you need to have this expression to refresh the data from the gallery:

Refresh('[dbo].[vwBestProducts]')

 


Thanks so much! I've been banging my head against a wall for hours until I found this Smiley Happy

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 166 members 4,232 guests
Please welcome our newest community members: