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 / How to Update Gallery ...
Power Apps
Unanswered

How to Update Gallery Items on Collection Change

(0) ShareShare
ReportReport
Posted on by 2

I'm trying to build a timesheet tracker, which saves its data to a csv in SharePoint. I have a collection called NewTimeEntries, which is attached to a gallery. Within the gallery are multiple dropdowns and input fields. The issue I run into is when trying to import data back into the collection/gallery. When I import the csv data back into the collection, the gallery doesn't update. However, I can see that the collection NewTimeEntries is successfully updated with all the correct information. I'm unsure how I can get the gallery to update/refresh to have the dropdowns and input fields repopulate with the information in its collection. 

 

This is the function used on a button to import the csv data and update the collection:

 

ClearCollect(
 NewTimeEntries,
 ForAll(
 Table(ParseJSON(Timesheets_Import.Run(CurrentUser, FileName).response)),
 {
 Customer: Text(Value.Customer),
 SupportAgreement: Text(Value.SupportAgreement),
 SupportType: Text(Value.SupportType),
 Billable: Text(Value.Billable),
 Mon: Value(Value.Mon),
 Tue: Value(Value.Tue),
 Wed: Value(Value.Wed),
 Thu: Value(Value.Thu),
 Fri: Value(Value.Fri),
 Sat: Value(Value.Sat),
 Sun: Value(Value.Sun)
 }
 )
)

 

 

I've attached two screenshots. One is of my collection after using the import button and it gets updated. The other is of the gallery. You'll notice that a second entry is added by no information is populated from the collection.

 

Any help would be appreciated since I'm very new to this!

updatedCollection.png
notUpdatedGallery.png
Categories:
  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @powerAppNoobie 

     

    Since you are using a collection as the Items property of your gallery, use the OnChange property of your controls to Patch to the collection. Below is an example of the first column.

    Patch(NewTimeEntries, ThisItem, {Customer: Text(Value.Customer});

     

    Then for your save button, all you need is to patch the collection to your SharePoint list then refresh the collection:

    Patch('SharePoint List', NewTimeEntries);
    ClearCollect(NewTimeEntries, 'SharePoint List');

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • powerAppNoobie Profile Picture
    2 on at

    Thanks for the response @AARON_C!

     

    I may be a little confused but I don't believe I'm able to do this. I'm not using a static data source for this. The csv data that I import is done using a flow and returns the content of file, so there is no connector between the two. I parse through the returned csv data variable to create the updated collection (my code block above). 

     

    Outline of the Process 

    1. Click import button to initiate flow. (coded into the import button)

    2. Flow returns json object of csv body. (coded into the import button)

    3. Parse through the data to create an updated collection. (coded into the import button)

        - This collection is the Items property of the gallery.

    4. The collection is updated but the gallery does not represent the updated collection. 

     

    Is there another way to do what you suggested that doesn't require a data source?

     

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard