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 / Update gallery items
Power Apps
Unanswered

Update gallery items

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a gallery which filter depending on the dropdown values.

So i need to Update all the records to the Existing Datasource which gallery listed outs. So in my point Both Read and write the record takes place from the same dataSource. So  edited records need to update by replacing the existing record in the Datasource to the particular row.

 

My Screen:

 

I have this Function in ONSelect of the Submit button:

ganesan_gowri_0-1598033266884.png

The error i faced is, it updates one row at a time. So i need to update all the items in the Gallery list.

 

DataSource: aaaa  

excel.png

Categories:
  • SaiKrishnaGudluru Profile Picture
    499 on at

    @Anonymous it loops through all the records in the gallery - but update happens only to the filtered records. Validate if you have only record matching to the filter in your data source.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Filtering the Gallery depends on dropdowns, i have two records that  matching to the filter in my data source.

    Here i have two rows but while hit submit , it update only the first row(aara record) and second row is not getting updated.

     

    screen.png

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @Anonymous ,'

    Your problem is your First() syntax as this will only ever patch one record - try

    ForAll(
     Gallery_l. AllItems,
     Patch(
     aaaa, 
     {Facility:Dropdownl_2.Selected.Result},
     {
     Comment :TextInput3_l.Text,
     'TOTAL SCHED':Textlnput2_l.Text
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the Answer. 

     

    Using your formula it creates a new record in the DataSource.  Actually i get the record From Excel to the Gallery and i use TextBox inside the gallery to edit some of the columns from the excel . So then again i want to save the  edited values by replace the existing values to the particular record without creating a new record. Thanks

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @Anonymous ,

    The argument

    {Facility:Dropdownl_2.Selected.Result}

    will update any record where the Field facility in your list matches the item selected in Dropdown1_2, and I took this straight off your code assuming it was what you needed, however you need to refer to a field in the gallery to match the list to identify the correct record to Patch and you have not supplied this. For instance if Facility was in your gallery and you want to patch the matching records - you would do this.

    ForAll(
     Gallery_l. AllItems As MyPatch,
     Patch(
     aaaa, 
     {Facility:MyPatch.Facility},
     {
     Comment :TextInput3_l.Text,
     'TOTAL SCHED':Textlnput2_l.Text
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Need to Update the newly edited values by replacing the Existing values to the respective rows. 

     

    Depending on the facility selected Gallery will  list out the records. So now i want to edit  the mark and comment for the listed out records. In my gallery For dropdown--> AA it list out 3 record of staffs, students, staffs. so i edited  mark and comment column for all the three records  . While hit save it want to update all the gallery items and replace the old values in DataSource and need to update the newly edited values to the specific fields of staffs and students. The datasource does reads and write to the same File. So i need to update the old values to the New values.

     

    Please verify my Screen and Excel Datasource

    DataSource: stu

    screen2.png

    Screen

    screen3.png

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    @Anonymous ,

    I am a little lost here - you are referring to a gallery, but have posted a screen shot of a form. What data do you want to update and where is it coming from? Also you do not seem to have a unique value key in your data to identify which record to Patch.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have a dataSource-Excel.  Gallery refer from the datasource. In the previous screen that i  shared consists of dropdown and gallery with Editable textinput boxes. I used function to filter the Gallery by dropdown Selected. While if i want to re-edit the record values that shows in the gallery i used textinput box to edit and want to update the Re-Edited values to the respective row in the Excel DataSource. 

     

    In this case i use First Function. So It Updates only the First record and one record at a time

     

    screen3.png

     

     

    My need is : To Update all the rows or Records in the gallery to the DataSource with respective to the same record with one button click. I Dropdown values and Type Value as  Unique Values.

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    @Anonymous ,

    Which column do you need to match the value on the form?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I need to match the Type column and Facility dropdown value selected column.

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard