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 / Refreshing gallery on ...
Power Apps
Answered

Refreshing gallery on different screen possible?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have a simple PowerApp, which allows a user to add records to a gallery. For example, Screen1 has a gallery of items which are stored in a SharePoint list and a button for "Add New Item".

 

When the user clicks the button Screen2 is displayed with another gallery which is basically just a list of items. When the user selects an item on Screen2, that item is added to the SharePoint list which is attached to Screen1, then the user is returned to Screen1.

 

Adding the item to the SharePoint list is working fine, but when the user is returned to Screen1, the gallery is not updated to display this newly added item...how can I update the gallery on Screen1 when the user selects an item on Screen2?

 

I tried to Refresh() the datasource (SharePoint list) attached to the gallery on Screen1 but that does not work. I'm not sure if there is a special formula to achieve this...

 

Thanks for the help!


Edit: as a workaround, I have added a button on Screen1 to refresh the gallery but I would really like to automate this step. I've noticed that when I add the first item, the gallery updates as expected but any subsequent items do not update the gallery until I click the refresh button...

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

    Hi @Anonymous,

     

     

    Could you please share the formula you used for the button (Select), which used to add the record in screen 2?

    I tested with patch function together with Navigate, the first screen would be automatically refreshed after I click the button.

    Formula I used under the Button Onselect property is the following:

    Patch('Testing list',Defaults('Testing list'),{record data});Navigate(BrowseScreen1, ScreenTransition.None)

    You may take a try to change the select an item action on Screen 2 with the format above, see if it would make it work.

     

    If not wotk, try the following:

    Under the Onselect property of the select action in screen2, add the following:

    button1.pressed

    Which would trigger the Button1 (Added in screen 1 for refresh), to refresh the data source.

    If you need any further assistance, please post back.

     

    Regards,

    Michael

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-micsh-msft,

     

    I am posting this on behalf of Tudor as he couldn't reply again on this post.

     

    "Thanks for the help, the formula I was using was to update the SharePoint list and then refresh the data source since both the gallery on Screen1 and the one on Screen2 are attached to the same SharePoint list, this is the formula:

     

    CreateSOPLine.Run(TextInput2, 1, ThisItem.Title, ThisItem.Amount, ThisItem.Item_x0020_Image); Refresh(SOP_Header); Refresh(SOP_Lines); Navigate(EditScreen1, ScreenTransition.None)

    Note that CreateSOPLine is a flow that I have running when a record is selected.

     

    I tried the Patch option you recommeded but I am a bit worried about using it. Sometimes the records do display on the gallery on Screen1 but this behaviour is not consistent. If I add items to the gallery using Patch, sometimes there might be two records in the gallery when actually there is only one in the SharePoint list.

     

    My refresh button on Screen1 has the following formula:

     

    Refresh(SOP_Lines)

     

    This also works inconsistently, sometimes the gallery refreshes to display the items from the list and sometimes it does not. Do you know how I should refresh the gallery to have consistent behaviour?

     

    I tried calling this button using button1.pressed but that did not work either :(.

     

    Thanks for the help!

    Tudor

    "

     

    Thanks again,

    Jimmy

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Managed to figure this out. It was not working because of the order of my Refresh() calls.

     

    I changed:

    CreateSOPLine.Run(TextInput2, 1, ThisItem.Title, ThisItem.Amount, ThisItem.Item_x0020_Image); Refresh(SOP_Lines); Refresh(SOP_Header); Navigate(EditScreen1,ScreenTransition.None)

    To:

    CreateSOPLine.Run(TextInput2, 1, ThisItem.Title, ThisItem.Amount, ThisItem.Item_x0020_Image); Navigate(EditScreen1,ScreenTransition.None); Refresh(SOP_Lines); Refresh(SOP_Header)

    I'm not sure exactly why this order matters since it is refreshing the data source connection but this has fixed the refresh for me.

     

    Tudor

  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Thanks for the update.

     

    Regards,

    Michael

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard