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 / Problem with gallery u...
Power Apps
Unanswered

Problem with gallery update

(0) ShareShare
ReportReport
Posted on by 62

Hello everyone,

need your help.

I have a simple SP list:

kalakosha_0-1698661731883.png

Employee - users column;

From; To - date/time column

Days; Dep - text column

Close - choise column with Yes/No values

Based on the list data, I created 2 galleries: general - which shows the total number of vacation days of the employee, and detailed - which shows the employee requests.

kalakosha_1-1698662581464.png

For Gallery 1  the Item property is:

 

AddColumns(GroupBy(AddColumns(Vacation4, "EmplName", Employee.DisplayName), "EmplName", "GrpEmplName"), "TotalDays", 
 Sum(Filter(GrpEmplName, Close.Value = "No" && EmplName = Employee.DisplayName), Days))

 

i.e. I grouped all the requests by employee and counted the total days if status Close = No.

For NextArrow_1 in this gallery I set folowing value for OnSelect property:

 

Set(varRecord, Filter(Vacation4, Employee.DisplayName = ThisItem.EmplName));
Select(Parent)

 

For Galley2 Items property is:

 

Filter(varRecord,ThisRecord.Close.Value = "No")

 

In the allery, I can see the employee's requests in detail.

NextArrow_2 Omselect property:

 

Set(varRecord2, ThisItem);
Select(Parent);
EditForm(frmAddVacation)

 

AddVacation form has the following properties:

Item:

 

If(frmAddVacation.Mode=FormMode.New, Blank(), varRecord2)

 

OnSuccess:

 

If(
 frmAddVacation.Mode = FormMode.New,
Patch(
 Vacation4,
 Defaults(Vacation4),
 {
 Employee: cmbFrmEmployee.Selected,
 Dep: txtFrmDep.Text,
 From: dteStartDate.SelectedDate,
 To: dteEndDate.SelectedDate,
 Days: DataCardValue5.Text,
 Close: {Value: "No"}
 }),
Patch(Vacation4,
 LookUp(Vacation4, varRecord2.ID = ThisRecord.ID),
 {
 Employee: cmbFrmEmployee.Selected,
 Dep: txtFrmDep.Text,
 From: dteStartDate.SelectedDate,
 To: dteEndDate.SelectedDate,
 Days: DataCardValue5.Text,
 Close: {Value: "No"}
 }
 )
)

 

Problem one is : when I add a new request, it does not automatically appear in the Gallery_2. I have to click on a NextArrow_1 button.

Second problem: when I make changes to the gallery items, it doesn't show up automatically either. For example, when I change the date(From or To) and click on Submit button, the gallery still shows the old date. And again forced to click on the NextArrow_2 button to update the data.

What changes should I make so that I can automatically see new added items in the Gallery_2 as well and the changes I made are automatically reflected.

Thanks in advance!

Categories:
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @kalakosha 

     

    Refresh() your gallery or another way to refresh your gallery is to use the Reset() function on the gallery control. 

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Kalakosha Profile Picture
    62 on at

    Hi @SpongYe ,

    thanks for you answer.

    Did I understand you correctly: in order to use Refresh(), I have to create a separate button and set a OnSelect property to Refresh(). And, which gallery control should I set the value to Reset(), to use reset function.  Or should it also be a separate button? Please suggest me.

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @kalakosha 

     

    You can use the refresh after the item is submitted your datasource. I would suggest to put it here:

    If(
     frmAddVacation.Mode = FormMode.New,
    Patch(
     Vacation4,
     Defaults(Vacation4),
     {
     Employee: cmbFrmEmployee.Selected,
     Dep: txtFrmDep.Text,
     From: dteStartDate.SelectedDate,
     To: dteEndDate.SelectedDate,
     Days: DataCardValue5.Text,
     Close: {Value: "No"}
     }),
    Patch(Vacation4,
     LookUp(Vacation4, varRecord2.ID = ThisRecord.ID),
     {
     Employee: cmbFrmEmployee.Selected,
     Dep: txtFrmDep.Text,
     From: dteStartDate.SelectedDate,
     To: dteEndDate.SelectedDate,
     Days: DataCardValue5.Text,
     Close: {Value: "No"}
     }
     )
    );
    Refresh(Vacation4); // I assume Vacation4 is connected to your gallery as a datasource

     

    Skip the Reset() for now it does not automatically refresh the data source. Reset only resets the control to its default value, discarding any user changes.

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Kalakosha Profile Picture
    62 on at

    Hi @SpongYe ,

    Unfortunately, the suggested option does not work. Gallery is not updated. 

    Also tried to add 

    Refresh(Vacation4);
    Refresh(varRecord)

    does not work also.

    Maybe have any other thoughts?

     

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @kalakosha 

     

    Try to add a icon "Reload" and then OnSelect you add the code: 

    Refresh(Vacation4);

    SpongYe_0-1698677572763.png

     

    varRecord is connected to your SP list Vacation4 so refreshing that won't do anything unless your datasource is refreshed.

  • Kalakosha Profile Picture
    62 on at

    Hi @SpongYe ,

    doesn't help also.

    Gallery_2 updated only when I click on NextArrow_1 icon in Gallery_1.

  • Kalakosha Profile Picture
    62 on at

    I found the answer to my question here:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Gallery-does-not-update-after-form-submits-changes-adds-entry/td-p/328903 

    According to the recommendation, for Gallery_2 for Items property I set folowing value:

     

     

    Filter(Filter(Vacation4; Employee.DisplayName = Gallery_1.Selected.EmplName); Close.Value = "No")

     

     

    But now i faced another problem when i add new item to SP list or make changes to selected item in Gallery_2  - default selected item in Gallery_1 always switches to the first item.

    How to set Default value for Gallery_1 as a last selected item?

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard