web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Refresh Gallery in Scr...
Power Apps
Answered

Refresh Gallery in Screen Through A Button In Component

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi. I am new to powerapps, and am still understanding the connection between component and screen. Read some websites and watched a couple of youtube videos to get better understanding, yet I am still stuck with my current problem.

 

So I and my team, we are building an application using powerapps. What we are trying to achieve is to let user refreshes the data in the gallery by clicking or selecting a refresh button. The button is in the component. And our table (data) coming from Dynamics 365.

 

Here is what the screen looks like,

arnoldaad_0-1599460028310.png

 

We would like to let the user refreshes the data in the gallery by clicking the refresh button. So far we have no luck. What we have already done is something like the following.

 

1. We created a component named SubheaderList that looks like below, with the customer property as displayed below.

arnoldaad_1-1599460138571.png

arnoldaad_2-1599460223147.png

 

2. In the IconRefresh (still in the component), we input the following to the OnSelect

arnoldaad_3-1599460368680.png

 

3. Then, we moved to the screens. In the corresponding screen, we selected the table that is used to display the data in the gallery, in the component properties (in the screen)

arnoldaad_4-1599461539057.png

 

When we played the screen, we got the following error : Only managed connections can be refreshed. We tried to move the button to the the screen directly (removed it from the component and insert the button directly to the screen). The new button OnSelect property, we input Refresh(TABLE). And it worked just fine. When user selects the button, the data is refreshed.

 

Please advise where did we go wrong with the component approach. Big thanks in advance.

 

Arnold-

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous :

    Firstly,let me explan why the Refresh function do not work in the Component.

    The point is the scope of a component is limited to itself.In other word,it is not available to refresh your data source by component.I think this link will help you a lot:

    Scope

    Secondly,I have two alternatives:

    Solution1:Create a button outside the component and set it's Items property to:

     

    Refresh(TABLE)

     

    Solution2:Use component's OutPut to influence external controls, and then use external controls to complete Refresh. (I do not recommend this method)

    Please refer to the following link for the specific solution:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Question-PowerApps-Components-How-to-Refresh-Data-Sources-and-Do/td-p/509985

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, @v-bofeng-msft ! Thanks for the answer. Will take a look at your link and try to get the best solution.

     

    The reason why we are thinking to put the refresh in the component, because the refresh icon is displayed almost in every screen, as requested by our user. Therefore, we are thinking rather than putting the icon in the screen directly, why not we put the icon in the component.

     

    Thanks again for your feedback. We will try to implement your suggestion and will let you know whatever the results are.

     

    Regards,

    Arnold

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous :

    After a night of thinking, I perfected this solution.Here is my test for your refrence:

    In the compontent

    1\Add a Custom Output property -Refresh

    2\Set the button 's items property to

     

    Set(var,!var) /*var is my custom variable in this component*/

     

     3\Set the Refresh property to

     

    Refresh

     

     In the App

    1\Add a Toggle control in any screen(I have tried that no matter which screen it is placed on, the function can be triggered successfully)

    Default

     

    ComponentName1.Refresh=ComponentName2.Refresh /*As long as the output of Refresh of one of the two components changes, the value will change*/

     

    If you have more components, you need to reconsider the calculation logic.

    OnChange

     

    Refresh(YourDataSource1);
    Refresh(YourDataSource2);

     

    Refresh all data sources, so you only need a toggle

    Visible

     

    false /*Let this control unvisible*/

     

    85.gif

     Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard